From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9CB5E1393DD for ; Fri, 22 Aug 2014 19:10:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 31080E0833; Fri, 22 Aug 2014 19:10:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 85F5AE0833 for ; Fri, 22 Aug 2014 19:10:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8EF3E33FFEE for ; Fri, 22 Aug 2014 19:10:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3BD8A3BE6 for ; Fri, 22 Aug 2014 19:10:09 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1407434044.647e08eb9166d23d0c64f0c8767d93a06bd21a40.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/tmpfiles.sh.in X-VCS-Directories: sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 647e08eb9166d23d0c64f0c8767d93a06bd21a40 X-VCS-Branch: master Date: Fri, 22 Aug 2014 19:10:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 901b961d-e30e-4c74-a39b-c3dda8c0292e X-Archives-Hash: 7d7e4ffa9ecaf94ef305df98faa4edf7 commit: 647e08eb9166d23d0c64f0c8767d93a06bd21a40 Author: Jason Zaman perfinion com> AuthorDate: Tue Aug 5 22:12:35 2014 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Aug 7 17:54:04 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=647e08eb tmpfiles.sh: do not use install install is in /usr which causes problems if /usr is not mounted. Instead, checkpath and "mkdir -p" can do everything required and are both available before /usr is mounted. Since checkpath also handles selinux labels correctly, _restorecon after is not required. X-Gentoo-Bug: 503408 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=503408 --- sh/tmpfiles.sh.in | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in index da64011..63c5d14 100755 --- a/sh/tmpfiles.sh.in +++ b/sh/tmpfiles.sh.in @@ -15,6 +15,7 @@ # DRYRUN=0 +CHECKPATH="@LIBEXECDIR@/bin/checkpath" checkprefix() { n=$1 @@ -87,9 +88,8 @@ _f() { [ $CREATE -gt 0 ] || return 0 if [ ! -e "$path" ]; then - dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" + dryrun_or_real $CHECKPATH -fq -m "$mode" -o "$uid:$gid" "$path" [ -z "$arg" ] || _w "$@" - _restorecon "$path" fi } @@ -99,9 +99,8 @@ _F() { [ $CREATE -gt 0 ] || return 0 - dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" + dryrun_or_real $CHECKPATH -Fq -m "$mode" -o "$uid:$gid" "$path" [ -z "$arg" ] || _w "$@" - _restorecon "$path" } _d() { @@ -111,8 +110,8 @@ _d() { [ $CREATE -gt 0 ] || return 0 if [ ! -d "$path" ]; then - dryrun_or_real install -d -m"$mode" -o"$uid" -g"$gid" "$path" - _restorecon "$path" + dryrun_or_real mkdir -p "$path" 2>/dev/null + dryrun_or_real $CHECKPATH -dq -m "$mode" -o "$uid:$gid" "$path" fi } @@ -126,8 +125,8 @@ _D() { fi if [ $CREATE -gt 0 ]; then - dryrun_or_real install -d -m"$mode" -o"$uid" -g"$gid" "$path" - _restorecon "$path" + dryrun_or_real mkdir -p "$path" 2>/dev/null + dryrun_or_real $CHECKPATH -Dq -m "$mode" -o "$uid:$gid" "$path" fi } @@ -145,9 +144,7 @@ _p() { [ $CREATE -gt 0 ] || return 0 if [ ! -p "$path" ]; then - dryrun_or_real mkfifo -m$mode "$path" - dryrun_or_real chown "$uid:$gid" "$path" - _restorecon "$path" + dryrun_or_real $CHECKPATH -pq -m $mode -o "$uid:$gid" "$path" fi } From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4F29E13877A for ; Thu, 7 Aug 2014 18:35:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 75CAEE0866; Thu, 7 Aug 2014 18:35:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0A21EE0866 for ; Thu, 7 Aug 2014 18:35:31 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F423733EAF3 for ; Thu, 7 Aug 2014 18:35:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 1B55718810 for ; Thu, 7 Aug 2014 18:35:29 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1407434044.647e08eb9166d23d0c64f0c8767d93a06bd21a40.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/tmpfiles.sh.in X-VCS-Directories: sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 647e08eb9166d23d0c64f0c8767d93a06bd21a40 X-VCS-Branch: master Date: Thu, 7 Aug 2014 18:35:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: cb204501-8a26-466a-83c5-83b2d6c24216 X-Archives-Hash: 75c52a701500fda7756135693fdae4d1 Message-ID: <20140807183529.MKU4QiiO-akGPwMc9jlXODx6eE1May6adqMky8-fIKs@z> commit: 647e08eb9166d23d0c64f0c8767d93a06bd21a40 Author: Jason Zaman perfinion com> AuthorDate: Tue Aug 5 22:12:35 2014 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Aug 7 17:54:04 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=647e08eb tmpfiles.sh: do not use install install is in /usr which causes problems if /usr is not mounted. Instead, checkpath and "mkdir -p" can do everything required and are both available before /usr is mounted. Since checkpath also handles selinux labels correctly, _restorecon after is not required. X-Gentoo-Bug: 503408 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=503408 --- sh/tmpfiles.sh.in | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sh/tmpfiles.sh.in b/sh/tmpfiles.sh.in index da64011..63c5d14 100755 --- a/sh/tmpfiles.sh.in +++ b/sh/tmpfiles.sh.in @@ -15,6 +15,7 @@ # DRYRUN=0 +CHECKPATH="@LIBEXECDIR@/bin/checkpath" checkprefix() { n=$1 @@ -87,9 +88,8 @@ _f() { [ $CREATE -gt 0 ] || return 0 if [ ! -e "$path" ]; then - dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" + dryrun_or_real $CHECKPATH -fq -m "$mode" -o "$uid:$gid" "$path" [ -z "$arg" ] || _w "$@" - _restorecon "$path" fi } @@ -99,9 +99,8 @@ _F() { [ $CREATE -gt 0 ] || return 0 - dryrun_or_real install -m"$mode" -o"$uid" -g"$gid" /dev/null "$path" + dryrun_or_real $CHECKPATH -Fq -m "$mode" -o "$uid:$gid" "$path" [ -z "$arg" ] || _w "$@" - _restorecon "$path" } _d() { @@ -111,8 +110,8 @@ _d() { [ $CREATE -gt 0 ] || return 0 if [ ! -d "$path" ]; then - dryrun_or_real install -d -m"$mode" -o"$uid" -g"$gid" "$path" - _restorecon "$path" + dryrun_or_real mkdir -p "$path" 2>/dev/null + dryrun_or_real $CHECKPATH -dq -m "$mode" -o "$uid:$gid" "$path" fi } @@ -126,8 +125,8 @@ _D() { fi if [ $CREATE -gt 0 ]; then - dryrun_or_real install -d -m"$mode" -o"$uid" -g"$gid" "$path" - _restorecon "$path" + dryrun_or_real mkdir -p "$path" 2>/dev/null + dryrun_or_real $CHECKPATH -Dq -m "$mode" -o "$uid:$gid" "$path" fi } @@ -145,9 +144,7 @@ _p() { [ $CREATE -gt 0 ] || return 0 if [ ! -p "$path" ]; then - dryrun_or_real mkfifo -m$mode "$path" - dryrun_or_real chown "$uid:$gid" "$path" - _restorecon "$path" + dryrun_or_real $CHECKPATH -pq -m $mode -o "$uid:$gid" "$path" fi }