Difficulties with samba usernames with spaces + patch

From: Tom Evans <tevans.uk_at_googlemail.com>
Date: Thu, 04 Oct 2007 15:19:09 +0100
Hi

I'm trying to enter into my fstab an entry to mount a SMB resource, but
I'm hitting a problem as my provided username has a space in the name.

I also noticed that mount_smbfs(8) has an undocumented -U switch that
allows you to set a username without having to use the
ugly //me_at_host/share syntax, so I've patched the man page to note this,
see attached patch.

This is perfectly fine on the command line, as one can quote the
required arguments when needed, but it seems impossible in fstab.
When mounted, mount -p is supposed to output the mounts in fstab(5)
format, but the output for samba mounts mounted with usernames with
spaces in does not work correctly.

None of these work:

//razor/it /mnt/it  smbfs rw,noauto,-U="Tom Evans"  0   0
//Tom Evans_at_razor /mnt/it smbfs rw,noauto 0 0
# this one suggested by mount -p
//TOM EVANS_at_RAZOR/IT /mnt/it  smbfs   rw 0 0

It is impossible to specify the username any other way, including
nsmb.conf or ~/.nsmbrc. Incidentally, Linux does this much more cleanly,
using a credentials file which can be specified as a mount option to
their mount.smbfs.

Mounting from the command line works either with correctly quoting the
host, or using the -U switch, and correctly quoting the argument.

mount_smbfs -U "Tom Evans" //RAZOR/it /mnt/it
mount_smbfs "//TOM EVANS_at_RAZOR/IT" /mnt/it

This clearly seems to be a limitation of fstab(5) (inability to quote
arguments) and/or nsmb.conf(5) (inability to specify username). I am
going to change one or the other to allow this to work; which would be
preferable?

Cheers

Tom

Received on Thu Oct 04 2007 - 12:43:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:18 UTC