Bug in smbmount?

Christopher K. Johnson chris.johnson at cmpco.com
Thu Jul 6 15:03:02 GMT 2000


Thanks for the suggestions Urban.
It's still a mystery folks - any other ideas?

Urban Widmark wrote:

> On Thu, 6 Jul 2000, Christopher K. Johnson wrote:
>
> > As root I can mount an NT share onto the Linux system:
> > /usr/bin/smbmount '//ntserver/myshare' /mnt/test -o
> > username=mylinuxuser,password=something,uid=myntuser,workgroup=CMP
> >
> > But the mount point gets forced to mode 555 instead of 755.  It's not an
> > NT write permission being expressed because as root on linux I can write
> > to the mounted directory (touch a file, etc.), but not as the owning
> > user of course since it does not have write permission.
>
> The argument to uid is a local uid (or username) so unless your nt
> username matches I think 'myntuser' is wrong (shouldn't matter, but I
> think you have mixed your nt and linux users here).

Sorry for the confusion - I switched them when I obfuscated my real security
info.
Correct NT and posix accounts are not the issue.

>
>
> Does specifying a mask for directories and files help?
>
> mount -t smbfs -o
> username=mylinuxuser,password=something,uid=myntuser,dmask=0755,fmask=0755
> //ntserver/myshare /mnt/test

I tried dmask=755 and it still forces 555 on the mount point.

>
>
> Does your root user have an umask set to 0222 or so when you run the mount
> command? I can reproduce it by doing:
> # umask 0222
> # mount -t smbfs -o ... /mnt/smb
> # ls -al /mnt/smb
> total 3
> dr-xr-xr-x   1 urban    root          512 Jul  1 21:41 ./
> ...
> # umount /mnt/smb
> # mount -t smbfs -o ...,dmask=0755,fmask=0755 /mnt/smb
> # ls -al /mnt/smb
> total 3
> drwxr-xr-x   1 urban    root          512 Jul  1 21:41 ./
> ...
>

No the root umask is 022.

>
> > Seems like a bug to me.
>
> Maybe. smbmnt does tricks with umask(), it looks quite intentional.
>
> /Urban

More key info:
The directories and files subordinate to the mount point are writeable.  i.e
#/usr/bin/smbmount '//ntserver/myshare' /mnt/test   \
> -o username=domuser,password=something,uid=chris,workgroup=CMP
#ls -ld /mnt/test
dr-xr-xr-x    1 chris    root          512 Jul  6 06:42 /mnt/test
#ls -ld /mnt/test/sub1
drwxr-xr-x    1 chris    root          512 Jul  6 06:42 /mnt/test/sub1

Furthermore immediately below this smbmount in the same script is another one

for a samba share from a linux server and the mount point in this case has
correct permissions:
#/usr/bin/smbmount '//smbserver/myshare' /mnt/test2  \
> -o username=domuser,password=something,uid=chris,workgroup=CMP
#ls -ld /mnt/test2
drwxr-xr-x    1 chris    root          512 Jul  6 06:42 /mnt/test2

-- Chris



More information about the samba mailing list