summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-11 13:12:28 -0400
committerDave Reisner <dreisner@archlinux.org>2012-03-11 14:28:15 -0400
commit9fefe217d5e6dff9415e47e35f855740c11138f9 (patch)
treeeea9c94c1f3a29c5520c32b8f69b86516797bab0
parent11ac21c1cf74a428017c6335b7c74cf3cfedeb11 (diff)
arch-tmpfiles: don't try to resolve numeric UIDs/GIDs
The whole point of using numeric IDs is to avoid resolution in the passwd/group databases. If we encounter an ID which is simply numeric, leave it alone. Looks like I broke this in a4558c4c trying to be a bit too clever. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xarch-tmpfiles14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch-tmpfiles b/arch-tmpfiles
index 4b12841..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