Improve audit log output

Show the full command path in the actual audit log message, but still
only show the command name in the prefix.
This commit is contained in:
Joshua Boniface 2023-10-25 09:48:48 -04:00
parent 2ee2b2cb33
commit 82b0301c0e
1 changed files with 1 additions and 2 deletions

View File

@ -65,10 +65,9 @@ def audit():
"""
args = argv
args[0] = "pvc"
pid = getpid()
openlog(facility=LOG_AUTH, ident=f"{args[0]}[{pid}]")
openlog(facility=LOG_AUTH, ident=f"{args[0].split('/')[-1]}[{pid}]")
syslog(
f"""client audit: command "{' '.join(args)}" by user {environ.get('USER', None)}"""
)