summaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-01-20 16:48:24 -0600
committerWilliam Hubbs <williamh@gentoo.org>2012-01-22 11:56:24 -0600
commit6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330 (patch)
treea37362ae0f913e361b1e4dfec9910d7073bfbb36 /init.d
parent2990e5a2e3ec06180ebe63448239e1cdad7878dd (diff)
downloadopenrc-6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330.tar.gz
openrc-6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330.tar.bz2
openrc-6e2fbf6a0fd04f2ba4afca8b7a2ef9af34ebf330.tar.xz
Make checks for writable directory posix compliant
Reported-by: Maxim Kammerer <mk@de.su> X-Gentoo-Bug: 398931 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=398931
Diffstat (limited to 'init.d')
-rw-r--r--init.d/bootmisc.in5
-rw-r--r--init.d/consolefont.in2
-rw-r--r--init.d/keymaps.in2
-rw-r--r--init.d/termencoding.in2
4 files changed, 3 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
}
-dir_writable()
-{
- mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$
-}
-
: ${wipe_tmp:=${WIPE_TMP:-yes}}
: ${log_dmesg:=${LOG_DMESG:-yes}}
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
# 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
# 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
# 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