]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions: check if directory of logfile is writable
authorHarald Hoyer <harald@redhat.com>
Mon, 7 Mar 2011 11:59:29 +0000 (12:59 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 7 Mar 2011 12:37:11 +0000 (13:37 +0100)
Do not check, if the logfile itsself is writable. Check the directory
instead.

dracut-functions

index cc16760e7a16d6d2e10cf0a26b1081915c61ab17..6c7436768a153d68c232a907000e49ccf81d6004 100755 (executable)
@@ -64,10 +64,10 @@ is_func() {
 # Log initrd creation.
 if ! [[ $dracutlogfile ]]; then
     [[ $dracutbasedir = /usr/share/dracut ]] && \
-        dracutlogfile=/var/log/dracut.log || \
-        dracutlogfile=$HOME/dracut.log
-    if [[ -w $dracutlogfile ]]; then
-        >"$dracutlogfile"
+       dracutlogfile=/var/log/dracut.log || \
+       dracutlogfile=$HOME/dracut.log
+    if [[ -w ${dracutlogfile%/*} ]]; then
+        >>"$dracutlogfile"
     fi
 fi