1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-22 02:50:32 +03:00

Merge pull request #25 from altlinux/gpupdate_username_fix

Fix for 'None' username dropping to runner_factory
This commit is contained in:
NIR 2020-02-12 18:20:49 +04:00 committed by GitHub
commit 88ef8359f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,10 @@ def runner_factory(args, target):
if is_root():
# Only root may specify any username to update.
try:
username = pwd.getpwnam(args.user).pw_name
if args.user:
username = pwd.getpwnam(args.user).pw_name
else:
target = 'Computer'
except:
username = None
logstring = (