summaryrefslogtreecommitdiff
path: root/arch-tmpfiles
diff options
context:
space:
mode:
Diffstat (limited to 'arch-tmpfiles')
-rwxr-xr-xarch-tmpfiles20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch-tmpfiles b/arch-tmpfiles
index 3b94885..9355fdc 100755
--- a/arch-tmpfiles
+++ b/arch-tmpfiles
@@ -25,13 +25,19 @@ checkparams() {
fi
# uid must be numeric or a valid user name
- if [[ $uid ]] && ! getent passwd "$uid" >/dev/null; then
- return 1
+ # don't try to resolve numeric IDs in case they don't exist
+ if [[ $uid ]]; then
+ if [[ $uid != +([0-9]) ]] && ! getent passwd "$uid" >/dev/null; then
+ return 1
+ fi
fi
# gid must be numeric or a valid group name
- if [[ $gid ]] && ! getent group "$gid" >/dev/null; then
- return 1
+ # don't try to resolve numeric IDs in case they don't exist
+ if [[ $gid ]]; then
+ if [[ $gid != +([0-9]) ]] && ! getent group "$gid" >/dev/null; then
+ return 1
+ fi
fi
return 0
@@ -235,7 +241,7 @@ fi
# directories declared later in the tmpfiles_d array will override earlier
# directories, on a per file basis.
# Example: `/etc/tmpfiles.d/foo.conf' supersedes `/usr/lib/tmpfiles.d/foo.conf'.
-for path in "${tmpfiles_d[@]}"; do
+for path in "${@:-${tmpfiles_d[@]}}"; do
[[ -f $path ]] && fragments[${path##*/}]=${path%/*}
done
@@ -279,8 +285,8 @@ while read -d '' fragment; do
d|D) line[2]=0755 ;;
esac
fi
- [[ ${line[3]} = '-' ]] && line[3]=0
- [[ ${line[4]} = '-' ]] && line[4]=0
+ [[ ${line[3]} = '-' ]] && line[3]='root'
+ [[ ${line[4]} = '-' ]] && line[4]='root'
"_${line[@]}"
done <"$FILE"