Hi,
On Fri, 05 Oct 2018 14:18:08 +0200 Vincent Danjean <vdanj...@debian.org>
wrote:
> Package: autofs
> Version: 5.1.2-1
> Severity: important
>
> Hi,
>
> Since stretch update, there is no way to automount a smb share with a
'$' at
> the end of its name anymore. But these names are automaticcaly
generated by
> windows when the share is hidden by default...
>
> The auto.smb script has a awk script to protect the '$' character.
> It works for the local mount path and options (cf user='...'
parameter below),
> but not for the server path.
>
> # /etc/auto.smb nas-stbm
> -fstype=cifs,multiuser,cruid=0,sec=krb5,user="HOSTNAME\$" \
> "/GENOME$" "://nas-stbm/GENOME\$" \
> [...]
>
> I tweak /etc/auto.smb to get the options I wanted. But I tried
> to generate both version (quoted or not) :
> A: "/GENOME$" "://nas-stbm/GENOME\$"
> B: "/GENOME$" "://nas-stbm/GENOME$"
>
> Both fails.
> Running autofs in debug mode, for A, I got:
> Oct 5 13:30:50 ge91097 automount[14285]: attempting to mount entry
/srv/cifs2/nas-stbm/GENOME$
> Oct 5 13:30:50 ge91097 automount[14285]: lookup_mount:
lookup(program): /srv/cifs2/nas-stbm/GENOME$ ->
-fstype=cifs,multiuser,cruid=0,sec=krb5,user=HOSTNAME\$ ://nas-stbm/GENOME\$
> Oct 5 13:30:50 ge91097 automount[14285]: parse_mount: parse(sun):
expanded entry: -fstype=cifs,multiuser,cruid=0,sec=krb5,user=HOSTNAME\$
://nas-stbm/GENOME\$
> Oct 5 13:30:50 ge91097 automount[14285]: parse_mount: parse(sun):
gathered options: fstype=cifs,multiuser,cruid=0,sec=krb5,user=HOSTNAME$
> Oct 5 13:30:50 ge91097 automount[14285]: sun_mount: parse(sun):
mounting root /srv/cifs2/nas-stbm/GENOME$, mountpoint
/srv/cifs2/nas-stbm/GENOME$, what //nas-stbm/GENOME\$, fstype cifs,
options multiuser,cruid=0,sec=krb5,user=HOSTNAME$
> Oct 5 13:30:50 ge91097 automount[14285]: do_mount:
//nas-stbm/GENOME\$ /srv/cifs2/nas-stbm/GENOME$ type cifs options
multiuser,cruid=0,sec=krb5,user=HOSTNAME$ using module generic
> Oct 5 13:30:50 ge91097 automount[14285]: mount_mount: mount(generic):
calling mkdir_path /srv/cifs2/nas-stbm/GENOME$
> Oct 5 13:30:50 ge91097 automount[14285]: mount_mount: mount(generic):
calling mount -t cifs -o multiuser,cruid=0,sec=krb5,user=HOSTNAME$
//nas-stbm/GENOME\$ /srv/cifs2/nas-stbm/GENOME$
> => note the '\' before '$' that is kept in the server path
> [...]
> Oct 5 13:30:50 ge91097 automount[14285]: mount(generic): failed to
mount //nas-stbm/GENOME\$ (type cifs) on /srv/cifs2/nas-stbm/GENOME$
>
> For B, I got:
> Oct 5 13:43:17 ge91097 automount[15058]: lookup_mount:
lookup(program): /srv/cifs2/nas-stbm/GENOME$ ->
-fstype=cifs,multiuser,cruid=0,sec=krb5,user=HOSTNAME\$ ://nas-stbm/GENOME$
> Oct 5 13:43:17 ge91097 automount[15058]: parse_mount: parse(sun):
expanded entry: -fstype=cifs,multiuser,cruid=0,sec=krb5,user=HOSTNAME\$
://nas-stbm/GENOME
> Oct 5 13:43:17 ge91097 automount[15058]: parse_mount: parse(sun):
gathered options: fstype=cifs,multiuser,cruid=0,sec=krb5,user=HOSTNAME$
> Oct 5 13:43:17 ge91097 automount[15058]: sun_mount: parse(sun):
mounting root /srv/cifs2/nas-stbm/GENOME$, mountpoint
/srv/cifs2/nas-stbm/GENOME$, what //nas-stbm/GENOME, fstype cifs,
options multiuser,cruid=0,sec=krb5,user=HOSTNAME$
> Oct 5 13:43:17 ge91097 automount[15058]: do_mount: //nas-stbm/GENOME
/srv/cifs2/nas-stbm/GENOME$ type cifs options
multiuser,cruid=0,sec=krb5,user=HOSTNAME$ using module generic
> Oct 5 13:43:17 ge91097 automount[15058]: mount_mount: mount(generic):
calling mkdir_path /srv/cifs2/nas-stbm/GENOME$
> Oct 5 13:43:17 ge91097 automount[15058]: mount_mount: mount(generic):
calling mount -t cifs -o multiuser,cruid=0,sec=krb5,user=HOSTNAME$
//nas-stbm/GENOME /srv/cifs2/nas-stbm/GENOME$
> => note the missing '$' in the server path
> [...]
> Oct 5 13:43:17 ge91097 automount[15058]: mount(generic): failed to
mount //nas-stbm/GENOME (type cifs) on /srv/cifs2/nas-stbm/GENOME$
>
>
> I workaround the problem by renaming /sbin/mount.cifs into
mount.cifs.real
> and writing the following script in /sbin/mount.cifs:
> #!/bin/bash
> SHARE="${1/\\\$/\$}"
> shift
> exec "$0".real "$SHARE" "$@"
>
>
> Please, propose a way (whatever it is) to quote the share name.
This is interesting. The double quote feature for the "$" sign in
locations got added in 2007 [1].
Maybe a regression?
Mike
[1]
https://git.kernel.org/pub/scm/linux/storage/autofs/autofs.git/commit/?id=3243d2ffbe53eb3fe24e03b239ffcc5cb21e75e4