Bug 652900 - /var/log/rpmpkgs gets mislabeled everyday
Summary: /var/log/rpmpkgs gets mislabeled everyday
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm
Version: 5.5
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-13 12:37 UTC by Jorge Fábregas
Modified: 2013-03-11 14:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-11 14:13:19 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.