All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Hansper <georgeh@anstat.com.au>
To: autofs@linux.kernel.org
Subject: autofs 4.1.2 cannot use option: username=mydomain\\myuserid
Date: Wed, 14 Jul 2004 12:50:56 +1000	[thread overview]
Message-ID: <40F49F90.6040707@anstat.com.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

Hi,

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:

myshare  -fstype=smbfs,username=mydomain\\myuserid,password=insecure,uid=500,gid=500,fmask=775 ://winsvr/myshare

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:

	mydomain\myuserid

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

	username=mydomainmyuserid

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.

Regards,
	George Hansper

[-- Attachment #2: autofs-4.1.2-backslash.patch --]
[-- Type: text/x-patch, Size: 746 bytes --]

--- 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;
 			continue;
+		}
+		quote = 0;
 		*cp++ = *scp;
 	}
 	*cp = '\0';

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

             reply	other threads:[~2004-07-14  2:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-14  2:50 George Hansper [this message]
2004-07-14 14:47 ` autofs 4.1.2 cannot use option: username=mydomain\\myuserid raven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40F49F90.6040707@anstat.com.au \
    --to=georgeh@anstat.com.au \
    --cc=autofs@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.