From: Harald Hoyer Date: Mon, 7 Mar 2011 11:59:29 +0000 (+0100) Subject: dracut-functions: check if directory of logfile is writable X-Git-Tag: 009~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee89f474539b1d728cc2d041dc514db7f00f086c;p=thirdparty%2Fdracut.git dracut-functions: check if directory of logfile is writable Do not check, if the logfile itsself is writable. Check the directory instead. --- diff --git a/dracut-functions b/dracut-functions index cc16760e7..6c7436768 100755 --- a/dracut-functions +++ b/dracut-functions @@ -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