Bug 660329

Summary: Can you change init_logfile to append rather then write.
Product: [Fedora] Fedora Reporter: Daniel Walsh <dwalsh>
Component: pm-utilsAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: jskala, jskarvad, mcepl, mcepl, opensource, pknirsch, richard, selinux
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-08 13:33:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Walsh 2010-12-06 15:04:44 UTC
Something like


        rm -f "$1"
        exec >> "$1" 2>&1

That way I can give confined domains, the ability to append to the log file rather then write,  Write access allows a domain to truncate the log file.

Comment 1 Daniel Walsh 2010-12-06 15:07:30 UTC
In Rawhide we are generating AVC's like

type=AVC msg=audit(1291386897.399:52): avc:  denied  { write } for
pid=1824 comm="blockdev" path="/var/log/pm-powersave.log" dev=dm-0
ino=135133 scontext=system_u:system_r:fsadm_t:s0-s0:c0.c1023
tcontext=system_u:object_r:devicekit_var_log_t:s0 tclass=file


Which indicates the blockdev command is trying to write to pm-powersave.log.

# sesearch -A -s fsadm_t -t devicekit_var_log_t -c file -p append
Found 3 semantic av rules:
   allow fsadm_t logfile : file { getattr append } ; 

I currently allow domains to append to log files.

Comment 2 Tom London 2010-12-06 16:19:42 UTC
After locally applying this change to /usr/lib64/pm-utils/pm-functions, booting appears "clean".

Comment 3 Daniel Walsh 2010-12-20 20:37:31 UTC
*** Bug 663995 has been marked as a duplicate of this bug. ***