Bug 445623

Summary: mount.cifs credentials file support broken - doesn't strip newline
Product: [Fedora] Fedora Reporter: Mikel Ward <mikel>
Component: sambaAssignee: Jeff Layton <jlayton>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9CC: jlayton, jroland, marcus, matteo, pasteur, steved, ted
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://bugzilla.samba.org/attachment.cgi?id=3273&action=view
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-08 15:45:45 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 Mikel Ward 2008-05-08 02:15:00 UTC
I tried to mount a Samba file share using
//fileserver/share /media/fileserver cifs credentials=/home/mward/.fileserver 0 0
in /etc/fstab.

It failed.

Doing an strace on mount.cifs shows it's including the newline from
/home/mward/.fileserver (i.e. it is sending password\n instead of password).

It should read the password line from the credentials file without the \n.

Comment 1 Mikel Ward 2008-05-08 02:17:57 UTC
It sounds like this was also a problem in 2004, but should have been fixed then
(presumably in Samba 2.x).
http://lists.samba.org/archive/linux-cifs-client/2004-April/000131.html


Comment 2 Mikel Ward 2008-05-08 02:33:02 UTC
Was reported a few days ago (see URL) and a patch was provided.  Not sure if
it's been checked in upstream yet.

Comment 3 Simo Sorce 2008-05-08 02:38:18 UTC
it's upstream, will be fixed shortly.

Comment 4 Ted Percival 2008-05-08 03:08:15 UTC
Upstream bug report is https://bugzilla.samba.org/show_bug.cgi?id=5434

Comment 5 Bug Zapper 2008-05-14 10:48:55 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Eduard Vopicka 2008-05-14 14:12:14 UTC
Here is my quick ack to get around this problem:

awk 'BEGIN { printf("%s\n%s","username=myusername","password=mypassword")}'
>/tmp/credentials

Then cp /tmp/credentials /etc/credentials

BINGO, this does it!

Brgds,

Eduard Vopicka

Comment 7 James Derrick 2008-05-26 08:27:13 UTC
To add some version numbers:
F8 with samba-common-3.0.28a-0.fc8 works and mounts fine.
Copied the config files over to F9 with samba-common-3.2.0-1.pre3.9.fc9.i386 and
this failed with NT_STATUS_LOGON_FAILURE.

Eduard's workaround mounted the shares AOK after a reboot - thanks for the tip.

Comment 8 Jeff Layton 2008-12-08 15:45:45 UTC
Looks like this should now be fixed in current samba-client packages. I'm going to close this as fixed. Please reopen if that isn't the case.

Comment 9 Jim Roland, RHCE 2009-11-03 16:50:22 UTC
Requesting this issue be reopened.  This is not fixed in the current samba-client packages on RHEL 5.4 (samba-client 3.0.33-3.15.el5_4).  Still have to use the AWK trick above to satisfy the issue.  The EOL (\n) is still being sent to samba included in the password string.  I pulled out my hair for about 2 hours trying to locate the issue and why the NT (AD) account kept locking out due to bad password.  Please fix this ASAP, as this is required for a critical production system.

Comment 10 Jeff Layton 2009-11-03 18:25:48 UTC
This is a Fedora bug, and it's not broken in Fedora currently. We're aware of the regression in RHEL. Please see bug 532153.