Bug 121060

Summary: /var/log/yum.log is created with execute permissions 0755
Product: [Fedora] Fedora Reporter: Christopher Chan <cchan123>
Component: yumAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-05 03:12:59 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 Christopher Chan 2004-04-16 16:04:42 UTC
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-19 03:35:26 UTC
Fixed in cvs with:
logfd=os.open(conf.logfile, os.O_WRONLY | os.O_APPEND |  os.O_CREAT,
0644) instead of umask modification.