Bug 370991 - wrong mount.cifs man page entry
wrong mount.cifs man page entry
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: samba (Show other bugs)
5.1
All Linux
low Severity low
: ---
: ---
Assigned To: Jeff Layton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-08 04:43 EST by Thorsten Scherf
Modified: 2014-06-18 03:37 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-03 02:47:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Thorsten Scherf 2007-11-08 04:43:53 EST
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 17:47:57 EST
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 02:47:48 EST
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.

Note You need to log in before you can comment on or make changes to this bug.