From 9fefe217d5e6dff9415e47e35f855740c11138f9 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 11 Mar 2012 13:12:28 -0400 Subject: 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 --- arch-tmpfiles | 14 ++++++++++---- 1 file 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 -- cgit v1.2.3