mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
tools: Add try to pwd user name get.
This commit is contained in:
1 parent
31974bc7b6
commit
45d6f228cf
1 file changed
+3
@@ -302,7 +302,10 @@ def timestamp_to_old_pamhyr_date(time: int):
|
|||||||
|
|
||||||
def get_user_name():
|
def get_user_name():
|
||||||
if with_pwd:
|
if with_pwd:
|
||||||
|
try:
|
||||||
return pwd.getpwuid(os.getuid()).pw_gecos
|
return pwd.getpwuid(os.getuid()).pw_gecos
|
||||||
|
except:
|
||||||
|
return "Me"
|
||||||
else:
|
else:
|
||||||
return "Me"
|
return "Me"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user