mirror of
https://codeberg.org/kiss-community/kiss
synced 2025-01-22 02:14:39 -07:00
kiss: remove id usage
This commit is contained in:
parent
be0ea0a881
commit
4be8784476
16
kiss
16
kiss
@ -120,14 +120,11 @@ am_owner() {
|
|||||||
# Split the ls output into fields.
|
# Split the ls output into fields.
|
||||||
# Intentional, globbing disabled.
|
# Intentional, globbing disabled.
|
||||||
# shellcheck disable=2046,2086
|
# shellcheck disable=2046,2086
|
||||||
set -- "$1" $inf
|
read -r _ _ user _ <<EOF
|
||||||
|
$inf
|
||||||
|
EOF
|
||||||
|
|
||||||
user=$4
|
equ "$LOGNAME/$user" "$user/$LOGNAME"
|
||||||
|
|
||||||
uid=$(id -u "$user") ||
|
|
||||||
die "Invalid user '$user' for '$1'"
|
|
||||||
|
|
||||||
equ "$oid/$uid" "$uid/$oid"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
as_user() {
|
as_user() {
|
||||||
@ -1885,6 +1882,7 @@ main() {
|
|||||||
# Defaults for environment variables.
|
# Defaults for environment variables.
|
||||||
: "${KISS_COMPRESS:=gz}"
|
: "${KISS_COMPRESS:=gz}"
|
||||||
: "${KISS_PID:=$$}"
|
: "${KISS_PID:=$$}"
|
||||||
|
: "${LOGNAME:?POSIX requires LOGNAME be set}"
|
||||||
|
|
||||||
# Figure out which 'sudo' command to use based on the user's choice or what
|
# Figure out which 'sudo' command to use based on the user's choice or what
|
||||||
# is available on the system.
|
# is available on the system.
|
||||||
@ -1910,10 +1908,6 @@ main() {
|
|||||||
# the log files the package manager creates uring builds.
|
# the log files the package manager creates uring builds.
|
||||||
time=$(date +%Y-%m-%d-%H:%M)
|
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
|
create_tmp_dirs
|
||||||
|
|
||||||
# Catch errors and ensure that build files and directories are cleaned
|
# Catch errors and ensure that build files and directories are cleaned
|
||||||
|
Loading…
Reference in New Issue
Block a user