Bug 117013

Summary: mount_smbfs(8) doesn't document -U (username) argument
Product: Documentation Reporter: Tom Evans <tevans.uk>
Component: Books & ArticlesAssignee: Tom Rhodes <trhodes>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
mount_smbfs.diff.txt none

Description Tom Evans 2007-10-08 14:40:00 UTC
Whilst looking to add a username option to mount_smbfs(8), I noticed that one actually already existed, but was not documented in mount_smbfs(8). This patch just adds documentation for the switch.

Fix: Apply attached patch

Patch attached with submission follows:
How-To-Repeat: 'man 8 mount_smbfs'
Comment 1 Maxim Konovalov 2007-10-12 17:25:52 UTC
> >
> --- /usr/src/contrib/smbfs/mount_smbfs/mount_smbfs.8	2007-06-29 11:54:58.000000000 +0100
> +++ mount_smbfs.8	2007-10-04 13:06:15.000000000 +0100
> @@ -13,6 +13,7 @@
>  .Op Fl L Ar locale
>  .Op Fl M Ar crights : Ns Ar srights
>  .Op Fl N
> +.Op Fl U Ar username
>  .Op Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup
>  .Op Fl R Ar retrycount
>  .Op Fl T Ar timeout
> @@ -68,6 +69,8 @@
>  If no password is found,
>  .Nm
>  prompts for it.
> +.It Fl U Ar username
> +Use specified username to authenticate with.
>  .It Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup
>  Assign owner/group attributes to the newly created connection.
>  .It Fl R Ar retrycount
>
Does it really work?  If yes you need to update usage() in
mount_smbfs.c.

Speaking aside it's not clear why do you need -U when the mount
specification has a user part: //user@server/share.

-- 
Maxim Konovalov
Comment 2 Tom Evans 2007-10-24 10:09:52 UTC
Hmm, doesn't really handle MIME, base64 does it? 

I'll try again with a non signed version..

As to why I wanted the option, fstab doesn't allow quoting of the mount
point, which means a samba username with spaces in it cannot be
specified there. I was hoping that by using an option to mount_smbfs,
the username could be specified instead in the mountopts section of the
fstab entry (also impossible). 

It is largely irrelevant, since neither work, so I worked around the
issue with a custom rc script. This change is merely to document
undocumented features.

Tom

BTW, the interface to the PR system is truly awful - why the hell can a
PR only be updated by email? It is truly pap.
Comment 3 Tom Rhodes freebsd_committer freebsd_triage 2009-01-18 14:02:27 UTC
Hi,

[SNIP]: Patch and PR data

I'm looking at the code in contrib/smbfs/mount_smbfs and I don't
see the code for a -U option in the getopt() or switch statement.
Am I missing something?  Thanks,

-- 
Tom Rhodes
Comment 4 Tom Rhodes freebsd_committer freebsd_triage 2009-01-18 14:55:31 UTC
State Changed
From-To: open->feedback

Feedback in the PR.
Comment 5 Tom Evans 2009-01-20 09:21:51 UTC
Yes, there is no arg parsing code in smbfs/mount_smbfs/mount_smbfs.c
that parses the -U flag. It is done inside of smbfs/lib/smb/ctx.c, in
the smb_ctx_init() function, which then calls smb_ctx_setuser().
smb_ctx_init() is called from smbfs/mount_smbfs/mount_smbfs.c:131 (in my
RELENG_7 sources anyway.)

I found this when I was adding my own -U flag to mount_smbfs :)

Cheers

Tom
Comment 6 dfilter service freebsd_committer freebsd_triage 2009-01-22 08:29:49 UTC
Author: trhodes
Date: Thu Jan 22 08:29:39 2009
New Revision: 187583
URL: http://svn.freebsd.org/changeset/base/187583

Log:
  Document the "-U" option.  While it is not part of the
  getopt(), it is accepted through smb_ctx_init() in
  lib/smb/ctx.c.
  
  PR:		117013
  Submitted by:	Tom Evans <tevans.uk@googlemail.com> (original version)

Modified:
  head/contrib/smbfs/mount_smbfs/mount_smbfs.8
  head/contrib/smbfs/mount_smbfs/mount_smbfs.c

Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.8
==============================================================================
--- head/contrib/smbfs/mount_smbfs/mount_smbfs.8	Thu Jan 22 08:14:28 2009	(r187582)
+++ head/contrib/smbfs/mount_smbfs/mount_smbfs.8	Thu Jan 22 08:29:39 2009	(r187583)
@@ -1,6 +1,6 @@
 .\" $Id: mount_smbfs.8,v 1.10 2002/04/16 02:47:41 bp Exp $
 .\" $FreeBSD$
-.Dd March 10, 2000
+.Dd January 21, 2008
 .Dt MOUNT_SMBFS 8
 .Os
 .Sh NAME
@@ -16,6 +16,7 @@
 .Op Fl O Ar cowner : Ns Ar cgroup Ns / Ns Ar sowner : Ns Ar sgroup
 .Op Fl R Ar retrycount
 .Op Fl T Ar timeout
+.Op Fl U Ar username
 .Op Fl W Ar workgroup
 .Op Fl c Ar case
 .Op Fl d Ar mode
@@ -77,6 +78,8 @@ Default is 4.
 .It Fl T Ar timeout
 Timeout in seconds for each request.
 Default is 15.
+.It Fl U Ar username
+Username to authenticate with.
 .It Fl W Ar workgroup
 This option specifies the workgroup to be used in the authentication request.
 .It Fl c Ar case

Modified: head/contrib/smbfs/mount_smbfs/mount_smbfs.c
==============================================================================
--- head/contrib/smbfs/mount_smbfs/mount_smbfs.c	Thu Jan 22 08:14:28 2009	(r187582)
+++ head/contrib/smbfs/mount_smbfs/mount_smbfs.c	Thu Jan 22 08:29:39 2009	(r187583)
@@ -295,7 +295,7 @@ usage(void)
 	"usage: mount_smbfs [-E cs1:cs2] [-I host] [-L locale] [-M crights:srights]",
 	"                   [-N] [-O cowner:cgroup/sowner:sgroup] [-R retrycount]",
 	"                   [-T timeout] [-W workgroup] [-c case] [-d mode] [-f mode]",
-	"                   [-g gid] [-n opt] [-u uid] //user@server/share node");
+	"                   [-g gid] [-n opt] [-u uid] [-U username] //user@server/share node");
 
 	exit (1);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 7 Tom Rhodes freebsd_committer freebsd_triage 2009-01-22 08:33:10 UTC
State Changed
From-To: feedback->patched

Patch applied to CURRENT with a minor change, thanks! 


Comment 8 Tom Rhodes freebsd_committer freebsd_triage 2009-01-22 08:33:10 UTC
Responsible Changed
From-To: freebsd-doc->trhodes

Over to me, MFC reminder.
Comment 9 Garrett Cooper 2011-10-12 02:29:24 UTC
 	This has been resolved on all supported branches. Please close this PR.
Thanks,
-Garrett
Comment 10 Tom Rhodes freebsd_committer freebsd_triage 2012-07-21 16:46:23 UTC
State Changed
From-To: patched->closed

Changes have been merged for awhile now, thanks.