Upon rechecking the bug, turns out "&" is also problematic, but looks like removing its escaping is also enough to fix the problem. I sent an email upstream. Until then, I'll mark this as n/f as we might have to amend the patch to also include "&". I pasted a new test script in the bug, and it's also below:
#!/bin/bash
set -e
set -x
sudo apt update
sudo apt dist-upgrade -y
sudo apt install autofs samba smbclient cifs-utils -y
sudo mkdir /myshare /c /a\&b
echo "This is myshare." | sudo tee /myshare/myshare.txt
echo "This is C." | sudo tee /c/c.txt
echo "This is a&b." | sudo tee /a\&b/a\&b.txt
echo "
[myshare]
path = /myshare
read only = yes
guest ok = yes
[C$]
path = /c
read only = yes
guest ok = yes
[a&b]
path = /a&b
read only = yes
guest ok = yes
" | sudo tee -a /etc/samba/smb.conf
echo "/cifs /etc/auto.smb --timeout=300" | sudo tee -a /etc/auto.master
New changelog entries:
[ Andreas Hasenack ]
* d/p/fix-lookup-ldap-crash.patch: fix crash on startup due to uninitialized
config. (LP #1503034). (Closes: #901344).
* d/rules: Add LDFLAGS to avoid issues with accessing global variables in
shared libraries (LP #1470687, LP #1472115).
New changelog entries:
* New upstream release.
* debian/patches:
+ Rebase 11default_automaster_location.patch,
12disable_default_auto_master.patch and spelling-error-fixes.patch.
+ Add two more spelling fixes to spelling-error-fixes.patch.
* debian/{control,compat}:
+ Switch to debhelper-compat notation.
+ Bump to DH compat level version 12.
+ Drop autoconf from B-D.
* debian/control:
+ Bump Standards-Version: to 4.4.1. No changes needed.
+ Add Rules-Requires-Root: field and set it to "no".
* debian/rules:
+ Drop --with systemd. No longer provided in DH compat level >= 11.
New changelog entries:
[ Mike Gabriel ]
* New upstream release.
- Make browsable_dirs option functional. Configurable in autofs.conf.
(Closes: #784301).
- Fix FTBFS with clang. (Closes: #757038).
- Fix specification of nfsvers=4.1 (with minor version numbers) in
auto.master. (Closes: #892374).
* debian/patches:
+ Rebase some patches.
+ Drop do-not-check-for-modprobe-procfs-or-load-module.patch,
fix-autofs-manpage-whatis.patch, fix-autofsconf-manpage-section.patch.
Fixes shipped by upstream.
+ Add mount-hidden-samba-shares.patch. Fix regression between 5.0.8 and
5.1.1 regarding the mounting of hidden samba shares. (Closes: #787202,
#910367).
+ Add spelling-error-fixes.patch, fixing tons of spelling fixes. Thanks
lintian.
* debian/rules:
+ Add get-orig-source target.
+ Evoke install_samples upstream Makefile target explicitly during
dh_auto_install.
+ Enable all hardening flags.
* debian/control:
+ Bump to Standards-Version: 4.3.0. No changes needed.
+ Adopt autofs package. Thanks to Dmitry Smirnov and other contributors
for all the previous work. (Closes: #849148).
+ Explicit B-D on pkg-config.
+ Update Vcs-*: fields. Packaging has moved to salsa.debian.org.
(Closes: #902565).
+ Add B-D on dpkg-dev (>= 1.16.1.1~) for full hardening flag support.
+ Use secure URL in Homepage: field.
* debian/source/options:
+ Drop custom compression for debian/ folder's tarball.
* debian/autofs-ldap.<scripts>:
+ Ensure file permissions of /etc/autofs_ldap_auth.conf are set to
root:root:0600 via dpkg-statoverride. (Closes: #805028).
* debian/autofs.service:
+ Add nfs-client.target to Wants= key. Hopefully, this is sufficient to
fix #842199, if not, please reopen the bug. (Closes: #842199).
+ PID file is in /run, not /var/run (which is a symlink to /run).
+ Add Documentation= key.
* debian/copyright:
+ Drop outdated information from main header. Use https:// in URLs.
[ Stefan Potyra ]
* debian/control:
+ Add libtirpc-dev to build-depends.
* debian/rules:
+ Add option --with-libtirpc to configure. (Closes: #737679, #709366).
[ Andreas Hasenack ]
* debian/tests:
+ Add nfs-mount and smb-mount tests. (Closes: #901554).
[ Vincent McIntyre ]
* debian/patches:
+ Add hardening-flags.patch. Assure that automount is built with
DAEMON_CFLAGS. (Closes: #864857).
New changelog entries:
* QA upload.
[ Laurent Bigonville ]
* debian/control: Switch all the packages to Arch:linux-any
[ Andreas Henriksson ]
* Add e2fsprogs to build-dep and recommends (Closes: #887284)
* Drop incorrect depends on lsb-base
* Drop incorrect *build*-dep on lsb-base
New changelog entries:
* QA upload.
[ Laurent Bigonville ]
* Orphan the package, see #849148
* debian/watch: Update the URL now that kernel.org ftp has been shutdown
(Closes: #864849)
* debian/control: Add dependency against lsb-base (Closes: #864852)
* debian/autofs.postrm: Remove /etc/autofs.conf on purge (Closes: #788129)
* debian/autofs.dirs: Install empty /etc/auto.master.d directory (Closes:
#884233)
* debian/rules: Don't strip the binaries during the build so the dbgsym
packages actually contain the debugging symbols
* debian/control: Bump Standards-Version to 4.1.2 and bump the packages
priority from extra to optional, the former is now deprecated
* debian/control: Drop dh-systemd build-dependency and bump debhelper to (>=
9.20160709)
* debian/rules: Really enable the force shutdown signal handler as intended
(Closes: #743654)
* d/p/fix-autofsconf-manpage-section.patch: Fix manpage section
* d/p/fix-autofs-manpage-whatis.patch: Fix whatis entry for autofs.8
manpage (Closes: #864853)
* Move autofs.conf.5 manpage from autofs-ldap to the main autofs package
(Closes: #870653)
* debian/rules: Set --enable-sloppy-mount instead of modifying the
include/config.h file manually
* debian/control: Drop autofs5 transitional packages (Closes: #878205)
[ Timo Aaltonen ]
* Replace fix-ssldir.patch with fix-ssslib-search.patch, which is more
upstreamable. Preseed sssldir in rules.
+1