On Wed, 13 May 2009 13:30:50 +0800
Ian Kent <[email protected]> wrote:

> Ian Kent wrote:
> >> May 13 14:43:28 gw automount[15573]: mount_mount: mount(generic):
> >> calling mount -t cifs -s -o username=USERNAME,password=PASSWORD
> >> //xp0/C\$ /tmp/auto6t8L4W
> 
> Ohh, I get it, the "\" is a path separator for mount.cifs and I think
> the handling of it may have changed recently ish.

Around a year ago, yes.

> 
> So catch 22, autofs must escaped the "$" to prevent it being interpreted
> as a macro and the generic mount module has no special knowledge of cifs
> so it can't do anything about it. Worse, since "\" is a valid path
> separator for UNC paths we can't just check the fs type and translate
> them all. For example, what if we get :\\\\<server>\\service as the
> location?
> 

Right -- and it's even worse than that. '\' is a valid character in
posix path components. It's perfectly legitimate (though insane) to
have a file named:

/home/jlayton/crazy\file

'crazy\file' is a valid file/dir name.

I did a small writeup on this for the mount.cifs(8) manpage -- see the
section called 'SERVICE FORMATTING AND DELIMITERS'.

I think the only real way to solve this is to make sure that autofs
doesn't try to escape these characters before it calls mount. I don't
think mount does any variable interpolation, and I know mount.cifs
doesn't so there shouldn't be any need for escape chars before '$'
signs, assuming you're not handing these off to a shell of some sort.

-- 
Jeff Layton <[email protected]>

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

Reply via email to