Trying to use special_smb (see bug 192852 comment 5) I've noticed accessing shares doesn't work if they contain spaces (common for Windows). Adding \ or "" doesn't help. There's just no way to escape characters. At least fstab(5) allows using \040 or any other C-style sequence. $ cat /etc/auto_master /smb -smb $ /etc/autofs/special_smb somehost 2>/dev/null /Virtual Images -fstype=smbfs,-N,-U=,-I=somehost ://somehost/Virtual Images /Shared Documents -fstype=smbfs,-N,-U=,-I=somehost ://somehost/Shared Documents $ ls /smb/somehost load: 0.11 cmd: ls 92899 [autofscv] 1.35r 0.00u 0.00s 0% 2824k ^C $ automountd -d automountd: waiting for request from the kernel automountd: not forking due to -d flag; will exit after servicing a single request automountd: got request 254: from map -smb, path /smb/, prefix "/smb", key "somehost", options "" automountd: parsing map "-smb" automountd: executing "/etc/autofs/special_smb somehost" as pid 87751 automountd: "/etc/autofs/special_smb somehost", pid 87751, terminated gracefully automountd: found node defined at [kernel request]:0; not a mountpoint automountd: creating subtree at /smb automountd: creating subtree at /smb/somehost automountd: directory /smb/somehost does not exist, creating automountd: creating subtree at /smb/somehost/Virtual automountd: directory /smb/somehost/Virtual does not exist, creating automountd: creating subtree at /smb/somehost automountd: creating subtree at /smb/somehost automountd: creating subtree at /smb/somehost/Shared automountd: directory /smb/somehost/Shared does not exist, creating automountd: creating subtree at /smb/somehost automountd: creating subtree at /smb/somehost automountd: nothing to mount; exiting automountd: completing request 254 with error 0 Other systems appear to support escaping to some degree. http://docs.oracle.com/cd/E23823_01/html/816-4555/rfsrefer-98.html https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man5/auto_master.5.html
Test case: $ cat /etc/auto_master /foo auto_foo $ cat /etc/auto_foo Long\ Name -fstype=nullfs :/& $ ls -F /foo Long\/ $ automountd -d automountd: waiting for request from the kernel automountd: not forking due to -d flag; will exit after servicing a single request automountd: got request 363: from map auto_foo, path /foo/, prefix "/foo", key "", options "" automountd: parsing map "auto_foo" automountd: map "auto_foo" maps to "/etc/auto_foo" automountd: done parsing map "auto_foo" automountd: found node defined at [kernel request]:0; not a mountpoint automountd: creating subtree at /foo automountd: creating subtree at /foo/Long\134 automountd: directory /foo/Long\134 does not exist, creating automountd: creating subtree at /foo/Long\134 automountd: creating subtree at /foo/Long\134 automountd: nothing to mount; exiting automountd: completing request 363 with error 0 $ cat /etc/auto_foo foo\#bar -fstype=nullfs :/& $ ls -F /foo load: 0.24 cmd: ls 5515 [autofs_retry] 0.83r 0.00u 0.00s 0% 2824k ^C $ automountd -d automountd: waiting for request from the kernel automountd: not forking due to -d flag; will exit after servicing a single request automountd: got request 364: from map auto_foo, path /foo/, prefix "/foo", key "", options "" automountd: parsing map "auto_foo" automountd: map "auto_foo" maps to "/etc/auto_foo" automountd: truncated entry at auto_foo, line 2 automountd: completing request 364 with error 5 $ cat /etc/auto_master /- auto_foo $ cat /etc/auto_foo /mnt -fstype=nullfs :/Disk\ \#555 $ ls -F /mnt $ automountd -d automountd: waiting for request from the kernel automountd: not forking due to -d flag; will exit after servicing a single request automountd: got request 373: from map auto_foo, path /mnt/, prefix "/", key "", options "" automountd: parsing map "auto_foo" automountd: map "auto_foo" maps to "/etc/auto_foo" automountd: done parsing map "auto_foo" automountd: found node defined at auto_foo:1; it is a mountpoint automountd: executing "mount -t nullfs -o automounted /Disk\134 /mnt/" as pid 5861 mount_nullfs: /Disk\: No such file or directory automountd: "mount -t nullfs -o automounted /Disk\134 /mnt/", pid 5861, terminated with exit status 64 automountd: mount failed automountd: completing request 373 with error 5
Another interesting real example: mntpoint -fstype=fuse,allow_other :sshfs\#user@example.com\:/path/to/mount on FreeBSD would look mntpoint -fstype=whatever,allow_other,mountprog=/usr/local/bin/sshfs :user@example.com\:/path/to/mount or with private keys of ~foo/.ssh mntpoint -fstype=whatever,allow_other,ssh_command="sudo -u foo ssh",mountprog=/usr/local/bin/sshfs :user@example.com\:/path/to/mount https://help.ubuntu.com/community/Autofs $ automountd -d automountd: waiting for request from the kernel automountd: not forking due to -d flag; will exit after servicing a single request automountd: got request 16: from map auto_media, path /media/mntpoint/, prefix "/media", key "mntpoint", options "" automountd: parsing map "auto_media" automountd: map "auto_media" maps to "/etc/auto_media" automountd: done parsing map "auto_media" automountd: found node defined at auto_media:8; it is a mountpoint automountd: executing "mount -t whatever -o allow_other,ssh_command=,automounted ' /media/mntpoint/" as pid 82910 mount: ': Operation not supported by device automountd: "mount -t whatever -o allow_other,ssh_command=,automounted ' /media/mntpoint/", pid 82910, terminated with exit status 1 automountd: mount failed automountd: completing request 16 with error 5
A commit references this bug: Author: trasz Date: Fri Sep 5 14:32:09 UTC 2014 New revision: 271167 URL: http://svnweb.freebsd.org/changeset/base/271167 Log: Make it possible to quote names in autofs maps using double quotes. Note that this is a workaround, not a proper solution. If you know lex well, and want to help - please let me know, I'll explain how it should work. PR: 192968 MFC after: 1 week Sponsored by: The FreeBSD Foundation Changes: head/usr.sbin/autofs/token.l
A commit references this bug: Author: trasz Date: Wed Sep 17 08:25:49 UTC 2014 New revision: 271704 URL: http://svnweb.freebsd.org/changeset/base/271704 Log: MFC r271167: Make it possible to quote names in autofs maps using double quotes. Note that this is a workaround, not a proper solution. If you know lex well, and want to help - please let me know, I'll explain how it should work. PR: 192968 Approved by: re (kib) Sponsored by: The FreeBSD Foundation Changes: _U stable/10/ stable/10/usr.sbin/autofs/token.l
Meh, reopen. This way I won't forget that it should get fixed in a better way.
Close PRs that have had a corresponding fix committed.