From 025505865655805d9c3163ef5b1d0a5eea740dec Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Tue, 22 Dec 2020 13:46:45 +0200 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- actions/users | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/actions/users b/actions/users index fb91987ef..b60cdbb37 100755 --- a/actions/users +++ b/actions/users @@ -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):