mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
Merge Fix test-aa-notify on openSUSE Tumbleweed (new 'last')
The new 2037-proof `last` on openSUSE Tumbleweed doesn't support the `-1` option. Remove it, and cut off the output manually. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1180 Approved-by: Georgia Garcia <georgia.garcia@canonical.com> Merged-by: Georgia Garcia <georgia.garcia@canonical.com> (cherry picked from commitae978c1953
)d19db55a
Fix test-aa-notify on openSUSE Tumbleweed (new 'last')
This commit is contained in:
parent
70ade00801
commit
0b5a270045
1 changed files with 2 additions and 1 deletions
|
@ -142,7 +142,8 @@ 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', '-1', username, '--time-format', 'iso'])
|
||||
return_code, output = cmd(['last', username, '--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
|
||||
if output.startswith(username):
|
||||
|
|
Loading…
Add table
Reference in a new issue