mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
samba: use hex_filter when creating user and password #17065
This commit is contained in:
parent
83ad72d797
commit
e132128e13
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue