kiss: minor nits

This commit is contained in:
Dylan Araps 2021-07-19 08:18:49 +03:00
parent 650e786edb
commit 7c2c32fb37
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

11
kiss
View File

@ -67,8 +67,7 @@ tmp_file() {
_tmp_file_pre=$_tmp_file _tmp_file_pre=$_tmp_file
_tmp_file=$tmp_dir/$KISS_PID-$1-$2 _tmp_file=$tmp_dir/$KISS_PID-$1-$2
: > "$_tmp_file" || : > "$_tmp_file" || die "$1" "Failed to create temporary file"
die "$1" "Failed to create temporary file"
} }
tmp_file_copy() { tmp_file_copy() {
@ -114,13 +113,15 @@ as_root() {
*/doas|*/sudo|*/ssu) */doas|*/sudo|*/ssu)
log "Using '$cmd_su' (to become $user)" log "Using '$cmd_su' (to become $user)"
"$cmd_su" -u "$user" -- "$@" "$cmd_su" -u "$user" -- "$@"
;; ;;
*/su) */su)
log "Using 'su' (to become $user)" log "Using 'su' (to become $user)
printf 'Note: su will ask for password every time.\n%s\n' \ Note: su will ask for password every time.
' Use doas, sudo or ssu for more control.' Use doas, sudo or ssu for more control."
"$cmd_su" -c "$* <&3" "$user" 3<&0 </dev/tty "$cmd_su" -c "$* <&3" "$user" 3<&0 </dev/tty
;; ;;