From e132128e13a0531402103c3df7b08273896da8d3 Mon Sep 17 00:00:00 2001 From: Jakob Olsson Date: Wed, 20 Mar 2019 13:56:00 +0100 Subject: [PATCH] samba: use hex_filter when creating user and password #17065 --- samba3/files/samba.init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samba3/files/samba.init b/samba3/files/samba.init index 2441625c7..f3e5c722c 100755 --- a/samba3/files/samba.init +++ b/samba3/files/samba.init @@ -11,6 +11,11 @@ useradd() local password config_get user $1 user config_get password $1 password + + filter="0A;5C 6E" + [ "$(hex_filter "$user" "$filter" 1)" = "" ] || return + [ "$(hex_filter "$password" "$filter" 1)" = "" ] || return + if ! $(grep -rq "^$user:" /etc/passwd) ; then echo "adding user $user" adduser $user -s /bin/false -D -H -h /mnt/$user -g "samba,pass=$password" && smbpasswd $user $password