mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
Pass --fullnames to last in test-aa-notify.py
Code assumes full username would be printed, but this actually requires an extra command line option Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
@@ -140,7 +140,7 @@ Feb 4 13:40:38 XPS-13-9370 kernel: [128552.880347] audit: type=1400 audit({epoc
|
||||
if 'SUDO_USER' in os.environ:
|
||||
username = os.environ.get('SUDO_USER')
|
||||
|
||||
return_code, output = cmd(['last', username, '--time-format', 'iso'])
|
||||
return_code, output = cmd(['last', username, '--fullnames', '--time-format', 'iso'])
|
||||
output = output.split('\n')[0] # the first line is enough
|
||||
# example of output:
|
||||
# ubuntu tty7 :0 2024-01-05T14:29:11-03:00 gone - no logout
|
||||
|
Reference in New Issue
Block a user