33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
|
From e45ffb5d1fddf751f50bc268846d81659120be62 Mon Sep 17 00:00:00 2001
|
||
|
From: Harald Hoyer <harald@redhat.com>
|
||
|
Date: Wed, 20 Jul 2011 17:24:33 +0200
|
||
|
Subject: [PATCH] dracut-logger: create logfile with 0600 permissions
|
||
|
|
||
|
---
|
||
|
dracut-logger | 4 ++++
|
||
|
1 files changed, 4 insertions(+), 0 deletions(-)
|
||
|
|
||
|
diff --git a/dracut-logger b/dracut-logger
|
||
|
index 3bcce83..a5a3ee9 100755
|
||
|
--- a/dracut-logger
|
||
|
+++ b/dracut-logger
|
||
|
@@ -106,6 +106,7 @@ __DRACUT_LOGGER__=1
|
||
|
# @warning Function sets global variables @var maxloglvl and @syslogfacility.
|
||
|
# See file doc comment for details.
|
||
|
dlog_init() {
|
||
|
+ local __oldumask
|
||
|
# Skip initialization if it's already done.
|
||
|
[ -n "$maxloglvl" ] && return 0
|
||
|
|
||
|
@@ -118,7 +119,10 @@ dlog_init() {
|
||
|
if [ -z "$fileloglvl" ]; then
|
||
|
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
|
||
|
elif [ $fileloglvl -gt 0 ]; then
|
||
|
+ __oldumask=$(umask)
|
||
|
+ umask 0377
|
||
|
! [ -e "$logfile" ] && >"$logfile"
|
||
|
+ umask $__oldumask
|
||
|
if [ -w "$logfile" -a -f "$logfile" ]; then
|
||
|
# Mark new run in the log file
|
||
|
echo >>"$logfile"
|