Bug 370991

Summary: wrong mount.cifs man page entry
Product: Red Hat Enterprise Linux 5 Reporter: Thorsten Scherf <tscherf>
Component: sambaAssignee: Jeff Layton <jlayton>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.1CC: gdeschner, jlayton, jplans, ssorce, steved
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-03 07:47:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Thorsten Scherf 2007-11-08 09:43:53 UTC
Description of problem:
The mount.cifs man page states, that using "user=" in a credential file is the
correct method to specify which account should be used to mount a share:

user=arg
specifies  the  username  to  connect  as. If this is not given, then the
environment variable USER is used. This option can also take the form
"user%password"  or  "workgroup/user"  or  "workgroup/user%password"  to allow
the password and workgroup to be specified as part of the username.

Note
The cifs vfs accepts the parameter user=, or for users familiar with smbfs it
accepts the  longer form of the parameter username=. Similarly the longer smbfs
style parameter names may be accepted as synonyms for the shorter cifs
parameters pass=,dom=  and cred=.

This is not completely true. When using user=username I always get an error when
mounting the cifs share:

[root@server1 samba]# mount -a
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

dmesg:
CIFS VFS: cifs_mount failed w/return code = -13
CIFS VFS: Send error in SessSetup = -13

Using "username=username" instead of "user=username" fixed the problem.
 
   
Version-Release number of selected component (if applicable):
samba-client-3.0.23c-2

How reproducible:
create a credential file with user=
mount the share

Steps to Reproduce:
1.s.a.
2.
3.
  
Actual results:
error message

Expected results:
mounted share

Additional info:

Comment 1 Jeff Layton 2008-12-02 22:47:57 UTC
Looking at mount.cifs manpage that's in samba-client-3.0.28-1.el5_2.1.x86_64 (which is I think what shipped with RHEL5.2):

       credentials=filename
           specifies a file that contains a username and/or password. The
           format of the file is:

                         username=value
                         password=value
           This is preferred over having passwords in plaintext in a shared
           file, such as /etc/fstab. Be sure to protect any credentials file
           properly.

...I also pulled the manpage out of the package version against which this was reported and it says exactly the same thing. I think we should close this as NOTABUG. Do you agree?

Comment 2 Thorsten Scherf 2008-12-03 07:47:48 UTC
true, looks I got it wrong when I looked up the man-page. However, it's a bit confusing. When you pass these options on the commandline, you have to use user= and password=, see here:

 OPTIONS
       user=arg
          specifies the username to connect as. If this is not given, then the
          environment  variable  USER  is  used. This option can also take the
          form "user%password" or  "workgroup/user"  or  "workgroup/user%pass-
          word" to allow the password and workgroup to be specified as part of
          the username.

[...] 
       password=arg
          specifies  the  CIFS  password. If this option is not given then the
          environment variable PASSWD is used. If the password is  not  speci-
          fied directly or indirectly via an argument to mount mount.cifs will
          prompt for a password, unless the guest option is specified.
[...]

using the credentials file, you have to use:

credentials=filename
          specifies a file that contains a username and/or password. The  for-
          mat of the file is:

                    username=value
                    password=value
[...]

anyway, it works as described in the man-page. for for mixing this up. will close as NOTABUG.