Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Oct 2007 15:19:09 +0100
From:      Tom Evans <tevans.uk@googlemail.com>
To:        freebsd-current@freebsd.org
Subject:   Difficulties with samba usernames with spaces + patch
Message-ID:  <1191507549.1475.69.camel@localhost>

next in thread | raw e-mail | index | archive | help

--=-ef252wYDdzVKWRNo+3LY
Content-Type: multipart/mixed; boundary="=-mv2VCZtsi+ZXPySbHSmm"


--=-mv2VCZtsi+ZXPySbHSmm
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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@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=3D"Tom Evans"  0   0
//Tom Evans@razor /mnt/it smbfs rw,noauto 0 0
# this one suggested by mount -p
//TOM EVANS@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@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

--=-mv2VCZtsi+ZXPySbHSmm
Content-Disposition: attachment; filename=mount_smbfs.8.diff.txt
Content-Type: text/x-patch; name=mount_smbfs.8.diff.txt; charset=UTF-8
Content-Transfer-Encoding: base64

LS0tIC91c3Ivc3JjL2NvbnRyaWIvc21iZnMvbW91bnRfc21iZnMvbW91bnRfc21iZnMuOAkyMDA3
LTA2LTI5IDExOjU0OjU4LjAwMDAwMDAwMCArMDEwMA0KKysrIG1vdW50X3NtYmZzLjgJMjAwNy0x
MC0wNCAxMzowNjoxNS4wMDAwMDAwMDAgKzAxMDANCkBAIC0xMyw2ICsxMyw3IEBADQogLk9wIEZs
IEwgQXIgbG9jYWxlDQogLk9wIEZsIE0gQXIgY3JpZ2h0cyA6IE5zIEFyIHNyaWdodHMNCiAuT3Ag
RmwgTg0KKy5PcCBGbCBVIEFyIHVzZXJuYW1lDQogLk9wIEZsIE8gQXIgY293bmVyIDogTnMgQXIg
Y2dyb3VwIE5zIC8gTnMgQXIgc293bmVyIDogTnMgQXIgc2dyb3VwDQogLk9wIEZsIFIgQXIgcmV0
cnljb3VudA0KIC5PcCBGbCBUIEFyIHRpbWVvdXQNCkBAIC02OCw2ICs2OSw4IEBADQogSWYgbm8g
cGFzc3dvcmQgaXMgZm91bmQsDQogLk5tDQogcHJvbXB0cyBmb3IgaXQuDQorLkl0IEZsIFUgQXIg
dXNlcm5hbWUNCitVc2Ugc3BlY2lmaWVkIHVzZXJuYW1lIHRvIGF1dGhlbnRpY2F0ZSB3aXRoDQog
Lkl0IEZsIE8gQXIgY293bmVyIDogTnMgQXIgY2dyb3VwIE5zIC8gTnMgQXIgc293bmVyIDogTnMg
QXIgc2dyb3VwDQogQXNzaWduIG93bmVyL2dyb3VwIGF0dHJpYnV0ZXMgdG8gdGhlIG5ld2x5IGNy
ZWF0ZWQgY29ubmVjdGlvbi4NCiAuSXQgRmwgUiBBciByZXRyeWNvdW50DQo=


--=-mv2VCZtsi+ZXPySbHSmm--

--=-ef252wYDdzVKWRNo+3LY
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQBHBPZWlcRvFfyds/cRAhUjAKCcsKqMU47rwixKuGAVlkrFNKj/6QCguXWQ
l7XolUa1nh3p9FZOe0sbvLA=
=Ppij
-----END PGP SIGNATURE-----

--=-ef252wYDdzVKWRNo+3LY--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1191507549.1475.69.camel>