autofs 4.1.2 cannot use option: username=mydomain\\myuserid
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
modules/parse_sun.c renamed from modules/parse_sun.c.orig +11 -4
@@ -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' ;
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs
[email protected]
maintainerQuoted 10 lines · George Hansper
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:
Quoted 6 lines
mydomain\myuserid
The problem is that the new autofs strips ALL backslashes from the options, and supplies mount.smb with:
username=mydomainmyuserid
Odd. That's not what I thought it did.
I'll check as soon as I get a chance.
Thanks
Ian