Bug 652900

Summary: /var/log/rpmpkgs gets mislabeled everyday
Product: Red Hat Enterprise Linux 5 Reporter: Jorge Fábregas <jorge.fabregas>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NEXTRELEASE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 5.5CC: dwalsh, ffesti, jorge.fabregas
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-11 14:13:19 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 Jorge Fábregas 2010-11-13 12:37:11 UTC
Description of problem:
The shell script /etc/cron.daily/rpm  runs every day and creates the file /var/log/rpmpkgs with the wrong type (var_log_t) instead of the correct one: rpm_log_t.

This happens because the shell script creates a temporary file under /var/log/ (which is the holding tank for the "rpm -qa ..." output) and after the output is appended, the file is "moved" to rpmpkgs (thus preserving the type var_log_t as when it was created). 


A workaround would be to append "/sbin/restorecon /var/log/rpmpkgs" at the end of /etc/cron.daily/rpm



How reproducible:
Always


Steps to Reproduce:
1. Run /etc/cron.daily/rpm
2. ls -lZ /var/log/rpmpkgs*

  
Actual results:
-rw-r--r--  root root   user_u:object_r:var_log_t      /var/log/rpmpkgs
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.1
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.2
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.3
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.4

Expected results:
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.1
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.2
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.3
-rw-r--r--  root root system_u:object_r:rpm_log_t      /var/log/rpmpkgs.4

Additional info:
This doesn't cause any side effect on the system other than you get the warning of a mislabeld file when you run "fixfiles check".

Comment 1 Florian Festi 2013-03-11 14:13:19 UTC
RHEL5 is now in the development phase 2. This limits updates to critical issues only. While this issue might be annoying it is now too late to get it fixed.