run0: implement -k/-K to revoke temporary auth
This is meant to mirror sudo's -k/--reset-timestamp and -K/--remove-timestamp options, which revoke the temporary authorization provided by the timestamp files in /var/run/sudo/ts. To achieve the same effect in run0, we ask polkit to revoke our temporary authorization. If used with a command, run0 will revoke the temporary auth and then immediately authorize the user again, just like sudo -k. All the bus calls are completed synchronously, as they need to complete before authorizing the user anyway. Like sudo, the effect of -k/--reset-timestamp is to revoke only the tmpauthz that polkit would have used to authorize the command, if available. The -K/--remove-timestamp option will revoke all temporary authorizations across all ttys.
This commit is contained in:
committed by
Luca Boccassi
parent
075036f205
commit
78b53d0132
@@ -38,6 +38,7 @@ _run0() {
|
||||
--setenv --background
|
||||
)
|
||||
local OPTS="${opts_with_values[*]} -h --help -V --version --no-ask-password --slice-inherit --empower"
|
||||
OPTS="$OPTS -k --reset-timestamp -K --remove-timestamp"
|
||||
|
||||
local i
|
||||
for (( i=1; i <= COMP_CWORD; i++ )); do
|
||||
|
||||
Reference in New Issue
Block a user