Bug 144198 - cifs module parses passwords with embedded commas incorrectly
cifs module parses passwords with embedded commas incorrectly
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: samba (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Fenlason
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-04 18:12 EST by James J. Moore
Modified: 2014-08-31 19:27 EDT (History)
2 users (show)

See Also:
Fixed In Version: samba-3.0.10-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-13 20:32:28 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 James J. Moore 2005-01-04 18:12:02 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20041020

Description of problem:
Cannot mount a CIFS share when the authenticating user has a comma in
his/her password.  It does not matter whether the password is
specified on the command line, entered in response to a terminal
prompt, written to a credentials file, or set as the value of the
PASSWD environment variable.  It also occurs whether the user
attempting the mount is root or a regular user.

Version-Release number of selected component (if applicable):
samba-3.0.10-1.fc3

How reproducible:
Always

Steps to Reproduce:
1.  Assign targetuser a password including a comma.  It can be in
Active Directory, a Windows NT 4.0 domain, a Samba 3.x domain, or a
local Samba user database.
2.  Log in as root on the client workstation.
3.  Turn on CIFS debugging as follows: echo 1 > /proc/fs/cifs/cifsFYI
4.  If not already done, edit /etc/syslog.conf to capture debug output
to syslog, eg add the line:
*.debug       /var/log/debug
and restart the syslog daemon.
5.  Attempt to mount the CIFS share, e.g., /sbin/mount.cifs
//myserver/myshare /mnt/mylocaldir -o user=targetuser

    

Actual Results:  The mount fails with the error message:
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

The debug log contains the following information:
Jan  4 17:44:50 sampson kernel:  fs/cifs/cifsfs.c: Devname:
//myserver/myshare flags: 64
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: CIFS VFS: in
cifs_mount as Xid: 17 with uid: 0
Jan  4 17:44:50 sampson kernel: CIFS: Unknown mount option Oy
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Username: targetuser
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: UNC:
\\myserver\myshare ip: 192.168.1.1
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Socket created
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Existing smb sess
not found
Jan  4 17:44:50 sampson kernel:  fs/cifs/transport.c: For smb_command 114
Jan  4 17:44:50 sampson kernel:  fs/cifs/transport.c: Sending smb of
length 47
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Demultiplex PID: 3667
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Peek length rcvd:
0x24 beginning 0x65)
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c:  Mid 0x23 matched
- waking up
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Security Mode: 0x3
Capabilities: 0x80f3fd Time Zone: 300
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: In sesssetup
Jan  4 17:44:50 sampson kernel:  fs/cifs/transport.c: For smb_command 115
Jan  4 17:44:50 sampson kernel:  fs/cifs/transport.c: Sending smb of
length 216
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Peek length rcvd:
0x24 beginning 0x27)
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c:  Mid 0x24 matched
- waking up
Jan  4 17:44:50 sampson kernel: Status code returned 0xc000006d
NT_STATUS_LOGON_FAILURE
Jan  4 17:44:50 sampson kernel:  fs/cifs/netmisc.c:  !!Mapping smb
error code 5 to POSIX err -13 !!
Jan  4 17:44:50 sampson kernel:  CIFS VFS: Send error in SessSetup = -13
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: No session or bad tcon
Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: CIFS VFS: leaving
cifs_mount (xid = 17) rc = -13
Jan  4 17:44:50 sampson kernel:  CIFS VFS: cifs_mount failed w/return
code = -13Jan  4 17:44:50 sampson kernel:  fs/cifs/connect.c: Wait for
exit from demultiplex thread



Expected Results:  The share should mount normally when the password
is not included on the command line.

Additional info:

  The line in the debug output "CIFS: Unknown mount option Oy" is the
direct consequence of failing to parse the password correctly, because
the last three characters of the password were ',Oy'.  Consequently,
only the characters preceding the comma are processed as the user's
password.
Comment 1 Radu Cornea 2005-01-11 22:34:56 EST
Same problem here
Comment 2 Jay Fenlason 2005-01-13 20:32:28 EST
I wrote a patch for the mount.cifs in rawhide that fixes this. 

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