Bug 165069

Summary: mock throws IO error when run with restrictive umask
Product: [Fedora] Fedora Reporter: Jeff Sheltren <sheltren>
Component: mockAssignee: Seth Vidal <skvidal>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: 4CC: extras-qa
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: 2005-08-04 20:53:25 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:
Attachments:
Description Flags
proposed patch none

Description Jeff Sheltren 2005-08-04 02:33:53 UTC
Description of problem:
mock errors out if user's umask is too restrictive.

Steps to Reproduce:
1. umask 0077
2. mock some.src.srpm
  
Actual results:
init
prep
setup
Traceback (most recent call last):
  File "mock.py", line 786, in ?
    main()
  File "mock.py", line 774, in main
    my.build(srpm)
  File "mock.py", line 308, in build
    srpm_out = self.install_build_deps(srpm)
  File "mock.py", line 233, in install_build_deps
    shutil.copy2(srpm, dest)
  File "/usr/lib64/python2.4/shutil.py", line 92, in copy2
    copyfile(src, dst)
  File "/usr/lib64/python2.4/shutil.py", line 48, in copyfile
    fdst = open(dst, 'wb')
IOError: [Errno 13] Permission denied:
'/var/lib/mock/fedora-4-x86_64-core/root//builddir/build/originals'

Expected results:
Should rebuild srpm

Additional info:
It'd be nice if this would work even when user's umask is restrictive.  I'm
proposing this patch which sets the umask to 0022 before doing work in the chroot.

Comment 1 Jeff Sheltren 2005-08-04 02:33:53 UTC
Created attachment 117429 [details]
proposed patch

Comment 2 Seth Vidal 2005-08-04 20:53:25 UTC
committed.

thanks.

Comment 3 Seth Vidal 2005-08-04 20:55:15 UTC
not notabug - next release