Bug 121060 - /var/log/yum.log is created with execute permissions 0755
/var/log/yum.log is created with execute permissions 0755
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-16 12:04 EDT by Christopher Chan
Modified: 2014-01-21 17:49 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-05-04 23:12:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christopher Chan 2004-04-16 12:04:42 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

Description of problem:
/var/log/yum.log is created with file permissions 0755.
The permissions should be 0644.

possible workaround is to set umask to 0133, but i have not
checked if this would break rpm scriptlets

the fix would be to set umask to 0133 before opening the
logfile and restoring it afterwards.  Something like this patch:

--- yummain.py.orig	2004-04-03 15:12:38.000000000 -0600
+++ yummain.py	2004-04-16 11:02:51.016031536 -0500
@@ -84,8 +84,10 @@
         log=Logger(threshold=conf.debuglevel, file_object=sys.stdout)
         # syslog-style log
         if conf.uid == 0:
+            mask=os.umask(0133);
             logfd=os.open(conf.logfile, os.O_WRONLY | os.O_APPEND | 
os.O_CREAT)
             logfile = os.fdopen(logfd, 'a')
+            os.umask(mask);
             fcntl.fcntl(logfd, fcntl.F_SETFD)
             filelog=Logger(threshold=10, 
file_object=logfile,preprefix=clientStuff.printtime())
         else:



Version-Release number of selected component (if applicable):
yum-2.0.7-0.20040403

How reproducible:
Always

Steps to Reproduce:
1. rm /var/log/yum.log
2. yum update
3. ls -l /var/log/yum.log
    

Actual Results:  /var/log/yum.log created with invalid permissions 
that
include execute permission

Expected Results:  /var/log/yum.log should not have any execute 
permissions

Additional info:
Comment 1 Seth Vidal 2004-04-18 23:35:26 EDT
Fixed in cvs with:
logfd=os.open(conf.logfile, os.O_WRONLY | os.O_APPEND |  os.O_CREAT,
0644) instead of umask modification.


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