From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Rp1iu-0000CR-V8 for garchives@archives.gentoo.org; Sun, 22 Jan 2012 18:01:01 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 830DAE0B00; Sun, 22 Jan 2012 18:00:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3F78FE0B00 for ; Sun, 22 Jan 2012 18:00:53 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B5F391B402D for ; Sun, 22 Jan 2012 18:00:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B907380044 for ; Sun, 22 Jan 2012 18:00:50 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330.WilliamH@gentoo> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/, sh/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/bootmisc.in init.d/consolefont.in init.d/keymaps.in init.d/termencoding.in sh/runscript.sh.in X-VCS-Directories: init.d/ sh/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330 Date: Sun, 22 Jan 2012 18:00:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 396f199b-c1c9-47df-a279-b52ee1b99416 X-Archives-Hash: a406e925b58a01bda640bb5463a2fa56 commit: 6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330 Author: William Hubbs gentoo org> AuthorDate: Fri Jan 20 22:48:24 2012 +0000 Commit: William Hubbs gentoo org> CommitDate: Sun Jan 22 17:56:24 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3D6e2fbf6a Make checks for writable directory posix compliant Reported-by: Maxim Kammerer de.su> X-Gentoo-Bug: 398931 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=3D398931 --- init.d/bootmisc.in | 5 ----- init.d/consolefont.in | 2 +- init.d/keymaps.in | 2 +- init.d/termencoding.in | 2 +- sh/runscript.sh.in | 5 +++++ 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index ee3c20c..c3824e0 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -10,11 +10,6 @@ depend() keyword -prefix -timeout } =20 -dir_writable() -{ - mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$ -} - : ${wipe_tmp:=3D${WIPE_TMP:-yes}} : ${log_dmesg:=3D${LOG_DMESG:-yes}} =20 diff --git a/init.d/consolefont.in b/init.d/consolefont.in index f83b003..2f046d8 100644 --- a/init.d/consolefont.in +++ b/init.d/consolefont.in @@ -54,7 +54,7 @@ start() eend $retval =20 # Store the last font so we can use it ASAP on boot - if [ $retval -eq 0 -a -w "$RC_LIBEXECDIR" ]; then + if [ $retval -eq 0 ] && dir_writable "$RC_LIBEXECDIR"; then mkdir -p "$RC_LIBEXECDIR"/console for font in /usr/share/consolefonts/"$consolefont".*; do : diff --git a/init.d/keymaps.in b/init.d/keymaps.in index 1b96f49..851af5e 100644 --- a/init.d/keymaps.in +++ b/init.d/keymaps.in @@ -63,7 +63,7 @@ start() fi =20 # Save the keymapping for use immediately at boot - if [ -w "$RC_LIBEXECDIR" ]; then + if dir_writable "$RC_LIBEXECDIR"; then mkdir -p "$RC_LIBEXECDIR"/console dumpkeys >"$RC_LIBEXECDIR"/console/keymap fi diff --git a/init.d/termencoding.in b/init.d/termencoding.in index edba715..b421898 100644 --- a/init.d/termencoding.in +++ b/init.d/termencoding.in @@ -35,7 +35,7 @@ start() done =20 # Save the encoding for use immediately at boot - if [ -w "$RC_LIBEXECDIR" ]; then + if dir_writable "$RC_LIBEXECDIR"; then mkdir -p "$RC_LIBEXECDIR"/console if yesno ${unicode:-${UNICODE}}; then echo "" > "$RC_LIBEXECDIR"/console/unicode diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in index 8e7fa69..3b91001 100644 --- a/sh/runscript.sh.in +++ b/sh/runscript.sh.in @@ -4,6 +4,11 @@ # Copyright (c) 2007-2009 Roy Marples # Released under the 2-clause BSD license. =20 +dir_writable() +{ + mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$ +} + sourcex() { if [ "$1" =3D "-e" ]; then