Bug 127801 - autofs 4.1.2 cannot use option: username=mydomain\\myuserid
autofs 4.1.2 cannot use option: username=mydomain\\myuserid
Product: Fedora
Classification: Fedora
Component: autofs (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ian Kent
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2004-07-13 23:12 EDT by George Hansper
Modified: 2007-11-30 17:10 EST (History)
3 users (show)

See Also:
Fixed In Version: 4.1.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-04-22 00:36:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
autofs patch allowing backslashes to be quoted and included in options (746 bytes, patch)
2004-07-13 23:14 EDT, George Hansper
no flags Details | Diff

  None (edit)
Description George Hansper 2004-07-13 23:12:32 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Description of problem:

I've just upgraded to Fedora Core 2, and the autofs has changed from
3.1.7 to 4.1.2.
Previously, I would automount Windows shares using an auto.smb file
with an entry:


In the new autofs 4.1.2 package, the above entry provokes a bug which
was not present before.
Windows requires the username to be of the form:


The problem is that the new autofs strips ALL backslashes from the
options, and supplies
mount.smb with:


The attached patch fixes this, but I would suggest someone more
familiar with the package
review it, since I have not analysed the source to any great depth.

    George Hansper

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a share on a Windows domain

2. Add /etc/auto.smb to /etc/auto.master:
   /smb    /etc/auto.smb   --timeout=3600 -d

3. Add an entry for the windows share to /etc/auto.smb

4. Try to access /smb/myshare:
     ls /smb/myshare


Actual Results:  ls: /smb/myshare: No such file or directory

and in /var/log/messages:

Jul 14 12:12:34 georgeh automount[23932]: attempting to mount entry
Jul 14 12:12:34 georgeh automount[26603]: >> 26608: session setup
failed: ERRDOS - ERRnoaccess (Access denied.)
Jul 14 12:12:34 georgeh automount[26603]: >> SMB connection failed
Jul 14 12:12:34 georgeh automount[26603]: mount(generic): failed to
mount //winsvr/myshare (type smbfs) on /smb/myshare
Jul 14 12:12:34 georgeh automount[26603]: failed to mount /smb/myshare

Expected Results:  Listing of directory (Widows share)

Additional info:

Mounting from the command line works.

Also posted to <autofs@linux.kernel.org>


--- autofs-4.1.2/modules/parse_sun.c.orig	2004-02-04
02:23:21.000000000 +1100
+++ autofs-4.1.2/modules/parse_sun.c	2004-07-14 12:15:30.311818691 +1000
@@ -261,9 +261,12 @@
 	for (; *whence; whence++, n++) {
 		switch (*whence) {
 		case '\\':
-			quote = 1;
-			continue;
+			if( quote ) {
+				break;
+			} else {
+				quote = 1;
+				continue;
+			}
 		case ':':
 			if (expect_colon)
 				expect_colon = 0;
@@ -451,13 +454,17 @@
 	char *cp = ret;
 	const char *scp;
 	int origlen = strlen;
+	int quote = 0;
 	if (ret == NULL)
 		return NULL;
 	for (scp = str; strlen > 0 && *scp; scp++, strlen--) {
-		if (*scp == '\\')
+		if (*scp == '\\' && !quote ) {
+			quote = 1;
+		}
+		quote = 0;
 		*cp++ = *scp;
 	*cp = '\0';
Comment 1 George Hansper 2004-07-13 23:14:04 EDT
Created attachment 101885 [details]
autofs patch allowing backslashes to be quoted and included in options
Comment 2 Matthew Miller 2005-04-26 11:49:19 EDT
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.
Comment 3 Jeff Moyer 2006-04-19 17:01:42 EDT
Ian, is this still an issue?
Comment 4 Ian Kent 2006-04-19 21:49:19 EDT
(In reply to comment #3)
> Ian, is this still an issue?

I don't think so.

I'd recommend using the FC3 4.1.3 or going to the FC4 4.1.4.
It's likely that it would need to be built from a SRPM to satisfy libray
dependencies of course.

Comment 5 John Thacker 2006-04-22 00:36:56 EDT
Since FC2 is Fedora Legacy now, and this is not a security issue, it's not going
to be fixed in FC2.  Recommend upgrading to FC3 or FC4, or applying the patch
yourself if necessary.  Closing bug.

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