From ee89f474539b1d728cc2d041dc514db7f00f086c Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 7 Mar 2011 12:59:29 +0100 Subject: [PATCH] dracut-functions: check if directory of logfile is writable Do not check, if the logfile itsself is writable. Check the directory instead. --- dracut-functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.47.3