From owner-freebsd-current@FreeBSD.ORG Thu Oct 4 14:43:25 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C1BC16A417 for ; Thu, 4 Oct 2007 14:43:25 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by mx1.freebsd.org (Postfix) with ESMTP id A631B13C45B for ; Thu, 4 Oct 2007 14:43:24 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: by ug-out-1314.google.com with SMTP id a2so384381ugf for ; Thu, 04 Oct 2007 07:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:content-type:date:message-id:mime-version:x-mailer; bh=1RVCJ/GEZbpZsxPMRNAXfj8CVGqEu2OVueXlMIk8fyw=; b=DXMuamaDItphZfCYxInljskTMxM7CpKQFtRBdl/gwI4unK6qH/TfA1WnUhmKl7G/rCPSOTIC6JT23GfWRFw80SsHTcTmG0w63KonyjaT+MNEcprGCVBtMVxRJyag8/Zwewes5WxGXD6xh1xhwG4x4J7d3opAYxjWfXfy4xRCvYo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:subject:from:to:content-type:date:message-id:mime-version:x-mailer; b=hoo9XfgiAxT+zyxCKro2lbmLT/aMG0YBpuLSDYyI4gBQ1FUxRhuk+XUVZvzD1A7NPWWS8Ov5oLVUmEPehjGUQ86nRCyJHddsiYF9WIeEuFaulDY7ZnTyzhX2m3aoVTBQWh5H5MKPWA1TB4XSqpVGZSxdg0JcSPSxubAcm5Mzrv8= Received: by 10.67.16.5 with SMTP id t5mr2009717ugi.1191507551922; Thu, 04 Oct 2007 07:19:11 -0700 (PDT) Received: from ?127.0.0.1? ( [217.206.187.79]) by mx.google.com with ESMTPS id c4sm776745nfi.2007.10.04.07.19.10 (version=SSLv3 cipher=RC4-MD5); Thu, 04 Oct 2007 07:19:10 -0700 (PDT) From: Tom Evans To: freebsd-current@freebsd.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-ef252wYDdzVKWRNo+3LY" Date: Thu, 04 Oct 2007 15:19:09 +0100 Message-Id: <1191507549.1475.69.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.2 FreeBSD GNOME Team Port Subject: Difficulties with samba usernames with spaces + patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Oct 2007 14:43:25 -0000 --=-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--