aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-03-11 19:29:21 +0100
committerTom Gundersen <teg@jklm.no>2012-03-11 19:29:21 +0100
commit28db00b0def506223ae55f5a7eef0dc94591fe91 (patch)
tree60b4d69df99887c6f9ae19fddd13f3e9b3bebf6f
parentbdad979a6f062228c318f0903f3d11c6865c5ff1 (diff)
parent9fefe217d5e6dff9415e47e35f855740c11138f9 (diff)
downloadinitscripts-28db00b0def506223ae55f5a7eef0dc94591fe91.tar.xz
Merge commit 'falconindy/working^1'
-rwxr-xr-xarch-tmpfiles16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch-tmpfiles b/arch-tmpfiles
index 3b94885..8d927de 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