From 11ac21c1cf74a428017c6335b7c74cf3cfedeb11 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 9 Mar 2012 13:26:49 -0500 Subject: arch-tmpfiles: allow passing specific config files Modify our path collection loop to accept the remaining argv as paths to config files. This overrides the default lookup for config files in /etc, /lib, and /run so that single config files can be parsed at a time (e.g. during package installation). Signed-off-by: Dave Reisner --- arch-tmpfiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch-tmpfiles b/arch-tmpfiles index 3b94885..4b12841 100755 --- a/arch-tmpfiles +++ b/arch-tmpfiles @@ -235,7 +235,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 -- cgit v1.2.3 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