samba: samba-config: support user name with spaces

This commit is contained in:
mglae 2023-05-11 00:21:38 +02:00
parent 401b898ff5
commit 207500ef03

View File

@ -99,7 +99,7 @@ if [ ! -f /storage/.cache/services/samba.disabled ]; then
# this is done always in case user uses passwords in userconf.
# many thanks to viljoviitanen for this
printf "%s\n%s" "${SAMBA_PASSWORD}" "${SAMBA_PASSWORD}" | smbpasswd -s -a root >/dev/null 2>&1
printf "nobody = root\nroot = %s" "${SAMBA_USERNAME}" > /run/samba/samba.map
printf 'nobody = root\nroot = "%s"\n' "${SAMBA_USERNAME}" > /run/samba/samba.map
sed -e 's|^.[ \t]*.public.=.*| public = no |' \
-e 's|^.[ \t]*.username map.=.*||' \