-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add '-k' option #13
base: master
Are you sure you want to change the base?
Add '-k' option #13
Conversation
Forgot to mention that this fixes #12. |
@@ -4,8 +4,8 @@ set -u | |||
help() { | |||
cat <<-EOF | |||
Usage: | |||
sudo (-i | -s) [-n] [-u <user>] [<command> [--] [<args>...]] | |||
sudo [-ins] [-u <user>] <command> [--] [<args>...] | |||
sudo (-i | -s) [-n] [-k] [-u <user>] [<command> [--] [<args>...]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudo (-i | -s) [-n] [-k] [-u <user>] [<command> [--] [<args>...]] | |
sudo (-i | -k | -s) [-n] [-u <user>] [<command> [--] [<args>...]] |
else | ||
_doas $flag_s | ||
fi | ||
elif [ "$flag_i" ]; then | ||
_doas -- "$(user_shell)" -l -c 'cd "$HOME"; "$0" "$@"' "$@" | ||
elif [ "$flag_s" ]; then | ||
_doas -- "${SHELL:-$(user_shell)}" -c '"$0" "$@"' "$@" | ||
elif [ "$flag_k" ]; then | ||
doas $flag_k ${user:+-u "$user"} | ||
doas $flag_n ${user:+-u "$user"} "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is not correct. According to sudo(8)
, it seems that -k
can be combined with -i
or -s
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been testing on my own and according to doas(1)
, using -L
exits immediately, hence why the need of two separate calls. I haven't personally found a better solution yet.
@@ -21,8 +21,8 @@ sudo - execute a command as another user using doas | |||
|
|||
== SYNOPSIS | |||
|
|||
*sudo* (-i | -s) [-n] [-u <__user__>] [<__command__> [--] [<__args__>...]] + | |||
*sudo* [-ins] [-u <__user__>] <__command__> [--] [<__args__>...] + | |||
*sudo* (-i | -s) [-n] [-k] [-u <__user__>] [<__command__> [--] [<__args__>...]] + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*sudo* (-i | -s) [-n] [-k] [-u <__user__>] [<__command__> [--] [<__args__>...]] + | |
*sudo* (-i | -k | -s) [-n] [-u <__user__>] [<__command__> [--] [<__args__>...]] + |
Useful for eg. Arch Linux's makepkg which uses
-k
during its process.