kiss: remove id usage

This commit is contained in:
Dylan Araps 2021-07-19 19:12:55 +03:00
parent be0ea0a881
commit 4be8784476
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

16
kiss
View File

@ -120,14 +120,11 @@ am_owner() {
# Split the ls output into fields.
# Intentional, globbing disabled.
# shellcheck disable=2046,2086
set -- "$1" $inf
read -r _ _ user _ <<EOF
$inf
EOF
user=$4
uid=$(id -u "$user") ||
die "Invalid user '$user' for '$1'"
equ "$oid/$uid" "$uid/$oid"
equ "$LOGNAME/$user" "$user/$LOGNAME"
}
as_user() {
@ -1885,6 +1882,7 @@ main() {
# Defaults for environment variables.
: "${KISS_COMPRESS:=gz}"
: "${KISS_PID:=$$}"
: "${LOGNAME:?POSIX requires LOGNAME be set}"
# Figure out which 'sudo' command to use based on the user's choice or what
# is available on the system.
@ -1910,10 +1908,6 @@ main() {
# the log files the package manager creates uring builds.
time=$(date +%Y-%m-%d-%H:%M)
# Make note of the user's current ID to do root checks later on.
# This is used enough to warrant a place here.
oid=$(id -u)
create_tmp_dirs
# Catch errors and ensure that build files and directories are cleaned