mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
users: Remove timeout when creating Samba user
Fixes #2000 Tests performed: - All the users module tests pass - Create a user, add the user to the freedombox-share group, check that the user can connect to the Samba Group share. Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
1101674cf3
commit
0255058656
@ -365,13 +365,11 @@ def set_samba_user(username, password):
|
||||
|
||||
If a user already exists, update password.
|
||||
"""
|
||||
proc = subprocess.Popen(['smbpasswd', '-a', '-s', username],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
_, stderr = proc.communicate(input='{0}\n{0}\n'.format(password).encode(),
|
||||
timeout=10)
|
||||
proc = subprocess.run(['smbpasswd', '-a', '-s', username],
|
||||
input='{0}\n{0}\n'.format(password).encode(),
|
||||
stderr=subprocess.PIPE)
|
||||
if proc.returncode != 0:
|
||||
raise RuntimeError('Unable to add Samba user: ', stderr)
|
||||
raise RuntimeError('Unable to add Samba user: ', proc.stderr)
|
||||
|
||||
|
||||
def subcommand_set_user_password(arguments):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user