mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
samba: Ignore non-existent users who are in freedombox-share group
Fixes error 500 when trying to open Samba app page when at least one of the users in freedombox-share group doesn't exist. Tests performed in both stable and testing containers: - Installed Samba app. - Installed Deluge app (Plinth install/setup fails but the Debian package itself was installed). - Did `apt remove --purge deluged` from command line. - Checked that the debian-deluged user doesn't exist (`getent passwd`) and the user is in the freedombox-share group (`getent group`). - Checked that the Samba app page opens without errors. - Checked that all the Samba tests pass. Fixes #2411. Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
4b09d91f93
commit
22671510e6
@ -137,7 +137,11 @@ def get_users():
|
||||
|
||||
allowed_users = []
|
||||
for group_user in group_users:
|
||||
uid = pwd.getpwnam(group_user).pw_uid
|
||||
try:
|
||||
uid = pwd.getpwnam(group_user).pw_uid
|
||||
except KeyError: # User doesn't exist
|
||||
continue
|
||||
|
||||
if uid > 1000:
|
||||
allowed_users.append(group_user)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user