diff options
Diffstat (limited to 'arch-tmpfiles')
-rwxr-xr-x | arch-tmpfiles | 16 |
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 |