Bug 445623 - mount.cifs credentials file support broken - doesn't strip newline
mount.cifs credentials file support broken - doesn't strip newline
Product: Fedora
Classification: Fedora
Component: samba (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jeff Layton
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-05-07 22:15 EDT by Mikel Ward
Modified: 2014-06-18 03:37 EDT (History)
7 users (show)

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

Attachments (Terms of Use)

  None (edit)
Description Mikel Ward 2008-05-07 22:15:00 EDT
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-07 22:17:57 EDT
It sounds like this was also a problem in 2004, but should have been fixed then
(presumably in Samba 2.x).
Comment 2 Mikel Ward 2008-05-07 22:33:02 EDT
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-07 22:38:18 EDT
it's upstream, will be fixed shortly.
Comment 4 Ted Percival 2008-05-07 23:08:15 EDT
Upstream bug report is https://bugzilla.samba.org/show_bug.cgi?id=5434
Comment 5 Bug Zapper 2008-05-14 06:48:55 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Comment 6 Eduard Vopicka 2008-05-14 10:12:14 EDT
Here is my quick ack to get around this problem:

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

Then cp /tmp/credentials /etc/credentials

BINGO, this does it!


Eduard Vopicka
Comment 7 James Derrick 2008-05-26 04:27:13 EDT
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 10:45:45 EST
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 11:50:22 EST
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 13:25:48 EST
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.

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