Operating System - HP-UX
1833625 Members
3698 Online
110062 Solutions
New Discussion

Cifsmount differences mounting from windows or samba

 
Glenn Eades
Occasional Advisor

Cifsmount differences mounting from windows or samba

Hi all,

I had a nice setup where I used CIFS to mount a windows share from a real window box. As root I used the command:

/sbin/mount -F cifs machine:/SHARE /mnt/share

To mount it, and to see it, as the general user (genuser) this:
cifslogin -U winuser .....

Then when I cd down to /mnt/share and do an ls -l I see all the files appear to be owned by genuser. The files are really owned by winuser on the windows box. All is good, no problems creating updating or deleting files.

Then, the 'other side' decides to move the share to an AIX server running samba. No problem I think, but they now use mapping to map winuser to *their* unix user samba.

Now when I mount it the files are owned by UIDs from the other system (and no, they do not map to my UIDs, no centralized UID control, sigh).

As well, if I mount and then try to create a file as genuser I see this:

# echo "foo" >zzz
ksh: zzz: cannot create
# ll
total 2048
-rwxrw---- 1 22222 10401 0 Sep 25 14:08 zzz

So it appears that it starts to create the file, then the remote samba forces the owner to the remote samba ID and then I don't have permission to wite to it and my commands fail.

This is their share info:
[share]
path = /xxx/yyy/zzz
write list = samba-wr
force user = samba
force group = sapsys
create mask = 0770
security mask = 0770
directory mask = 0770
directory security mask = 0770

and they have a usermap like

samba-wr = winuser

Now, I don't control the other side, and 'it works from windows'.

What is my best option to get this working again? I think it will be to try to get them to create a real user that I can map to.

Any ideas?

Thanks,
Doug
6 REPLIES 6
Heironimus
Honored Contributor

Re: Cifsmount differences mounting from windows or samba

That looks like the CIFS unix extensions. I think you can disable them on the client side, but I haven't done enough with the HP CIFS Client to know where. The server can disable them for everybody with "unix extensions = no" in smb.conf.
OldSchool
Honored Contributor

Re: Cifsmount differences mounting from windows or samba

since you're going from aix to hpux, why not use NFS to mount it?
Tim Nelson
Honored Contributor

Re: Cifsmount differences mounting from windows or samba

I second Oldschool's comment.

UNIX to UNIX use UNIX Network File System.. Why convert from unix to Windoze to unix ?

You will still have issue with all the non matching usernames from AIX but that is what happens..
Glenn Eades
Occasional Advisor

Re: Cifsmount differences mounting from windows or samba

Thanks Heironimus, I was kind of suspecting that and have had the provider put 'unix extensions = no' in the share conf. That at least makes it act ok from a unix UID point of view, although I am still stuck with the UIDs not being the same across boxes.

OldSchool and Tim, yep, NFS is the fall back position but will involve some code changes as well as the UID mapping issue, so I was looking to find the magic switch that made it work exactly as the windows server did.

The real solution is to get universal UID mapping across the machines/company, but thats not happening soon...

As well, the files we are transferring are very big, which is why we want to mount 'their' share and write to it. If there is no space it is their problem, not ours. This is why we cannot create a local file and use an ftp/scp type solution.

With unix extensions turned off, this happens, it is almost useable if I become a local user with UID:GID 22222:10401

The only glitch is the initial creation of a file 'fails', IE it creates but canot be written to immediatly, but a second write to it works, as do moves and deletes:

osrjde04:/mnt/MEDBID10/uploads # echo "abc" >z
ksh: z: cannot create
osrjde04:/mnt/MEDBID10/uploads # ll z
-rwxrw---- 1 22222 10401 0 Sep 27 08:48 z
osrjde04:/mnt/MEDBID10/uploads # echo "abc" >z
osrjde04:/mnt/MEDBID10/uploads # ll z
-rwxrw---- 1 22222 10401 4 Sep 27 08:48 z

But this is probably to quirky to put into production, especially as the stuff to produce the file is all legacy stuff that needs to run as a different user than the 22222 one I am being given acces to. sigh.

Thanks for the info anyway guys.....

Heironimus
Honored Contributor

Re: Cifsmount differences mounting from windows or samba

The behavior you're describing sounds like the client side still thinks it should be using those settings. With UNIX extensions disabled the remote system wouldn't be sending anything to tell the local side what UIDs to use so having a strange UID/GID on files is probably an artifact of the client. Did you try removing all of the CIFS Client configuration for that mount and redoing it after the server disabled UNIX extensions?
Glenn Eades
Occasional Advisor

Re: Cifsmount differences mounting from windows or samba

The cfgdb.ppl is empty, so I don't think that would be it.

In any case, we are now going to move to NFS and change our code going forward.

Thanks for the responses anyway....

Doug

# /var/opt/cifsclient/cfgdb.ppl
#
# This file is automatically generated. Manual editing is
# discouraged--changes may be overwritten by the CIFS Client
# daemon.
#
# Last update: Wed Aug 8 12:06:43 2007
# @(#)HP CIFS Client - Version A.02.02.01

"main" = {
"automount" = (
);
};