Jason T. Masker wrote:
> I also tried changing the print line to the following:
> 
> print " \\\n\t \"/" dir "\"", "://" key "/" lo
> 
> 
> 
> so that the output looks like this:
> 
> $ sudo /etc/auto.cifs VMW1013
> -fstype=cifs,file_mode=0644,dir_mode=0755,uid=jmasker,gid=users,credentials=/etc/auto.smb.jmasker
> \
>          "/My Documents" ://VMW1013/My Documents \
>          "/ADMIN$" ://VMW1013/ADMIN\$ \
>          "/C$" ://VMW1013/C\$ \
>          "/Shared" ://VMW1013/Shared
> 
> 
> However, this results in automount dropping the $ as well.  The debug
> looks identical to what I just posted.

Yes, the location does need to double escape the dollar in the mount.
The double quotes are meant to preserve any spaces present in the
location but the "$" is also used as a macro introducer so it needs to
be escaped a second time so it doesn't get substituted with NULL when
the entry is expanded. What makes this difficult is the "\" is also a
separator and gets translated to "/" by mount.cifs. When you run the
mount from the command line the shell translates the "\$" to "$" before
it gets to mount.cifs.

I think the problem occurs because, when the entry is initially broken
up into mount triggers for each share and each is mounted, expanding the
map entry needs to preserve the "\$", but when the individual triggers
are walked on expanding the entry needs to substitute the "\$" for "$"
so the mount works. The problem being that the expand subroutine doesn't
know the difference between these two invocations.

I'll have a look and see.

Ian

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to