Bug 833350 - Tempfile ignores umask for files created in createrepo cache.
Tempfile ignores umask for files created in createrepo cache.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: createrepo (Show other bugs)
6.3
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: James Antill
Karel Srot
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-19 05:36 EDT by Marko Myllynen
Modified: 2013-02-21 03:42 EST (History)
0 users

See Also:
Fixed In Version: createrepo-0.9.9-15.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 03:42:09 EST
Type: Bug
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 Marko Myllynen 2012-06-19 05:36:35 EDT
Description of problem:
createrepo ignores umask for cachedir causing issues when more than one user are updating repositories:

localhost:~> umask 0002
localhost:~> mkdir -p foo/cache foo/repo
localhost:~> cp test.rpm foo/repo/
localhost:~> createrepo -q -c $HOME/foo/cache foo/repo
localhost:~> ls -al $HOME/foo/cache
total 12K
drwxrwxr-x. 2 testuser testuser 4.0K 2012-06-19 12:29 .
drwxrwxr-x. 4 testuser testuser 4.0K 2012-06-19 12:28 ..
-rw-------. 1 testuser testuser   64 2012-06-19 12:29 test.rpm-a015e8240f41d24ae54e37e3ceb4321dea35be5d51aef1e366ea42f1d537ee34d-1386895-1340099211
localhost:~> ls -al $HOME/foo/repo/repodata/primary.xml.gz 
-rw-rw-r--. 1 testuser testuser 961 2012-06-19 12:29 /home/mmyllyne/foo/repo/repodata/primary.xml.gz
localhost:~> 

Version-Release number of selected component (if applicable):
createrepo-0.9.8-5.el6.noarch
Comment 2 James Antill 2012-06-27 10:38:33 EDT
> createrepo ignores umask for cachedir causing issues when more than one user
> are updating repositories:

Not sure how safe this is, the general assumption is that the createrepo cache is for the repo. ... so you'd only run one at once. It's probably fine though (as I think everything uses atomic updates, and we have multiple workers upstream now).

I wouldn't be shocked if this bug was an rpm thing too.
Comment 3 RHEL Product and Program Management 2012-07-10 02:02:05 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 4 RHEL Product and Program Management 2012-07-10 19:11:03 EDT
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
Comment 5 RHEL Product and Program Management 2012-08-14 17:59:20 EDT
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.
Comment 8 Marko Myllynen 2012-09-18 04:52:59 EDT
Still failing with createrepo-0.9.9-13.el6:

localhost:~> rpm -q createrepo
createrepo-0.9.9-13.el6.noarch
localhost:~> rpm -V createrepo
localhost:~> umask 0002
localhost:~> rm -rf foo
localhost:~> mkdir -p foo/cache foo/repo
localhost:~> cp $HOME/createrepo-0.9.9-13.el6.noarch.rpm foo/repo/
localhost:~> createrepo -q -c $HOME/foo/cache foo/repo
localhost:~> ls -al $HOME/foo/cache
total 12K
drwxrwxr-x. 2 testuser testuser 4.0K 2012-09-18 11:50 .
drwxrwxr-x. 4 testuser testuser 4.0K 2012-09-18 11:50 ..
-rw-------. 1 testuser testuser   64 2012-09-18 11:50 createrepo-0.9.9-13.el6.noarch.rpm-6470ef7c38e3bb64e94fb35cfc1054563efd6e983613d4d0dad14a48df955c81-294508-1347958234
localhost:~>
Comment 9 Marko Myllynen 2012-10-05 03:18:20 EDT
Now with createrepo-0.9.9-14.el6 it's getting better:

localhost:~> rpm -q createrepo
createrepo-0.9.9-14.el6.noarch
localhost:~> rpm -V createrepo
localhost:~> umask 0002
localhost:~> rm -rf foo
localhost:~> mkdir -p foo/cache foo/repo
localhost:~> cp $HOME/createrepo-0.9.9-14.el6.noarch.rpm foo/repo/
localhost:~> createrepo -q -c $HOME/foo/cache foo/repo
localhost:~> ls -al $HOME/foo/cache
total 12K
drwxrwxr-x. 2 testuser testuser 4.0K 2012-10-05 10:07 .
drwxrwxr-x. 4 testuser testuser 4.0K 2012-10-05 10:05 ..
-rwxrwxr-x. 1 testuser testuser   64 2012-10-05 10:07 createrepo-0.9.9-14.el6.noarch.rpm-479ecb301d2b0ad9cdafe0f83ef485c69063ce547cc103ea622ea923defdfd0e-295093-1349392894
localhost:~> 

Note that after "umask 0002" one would expect files created not being executable.

However, since the group write permission is correct, I'll leave it up to others to decide whether this is ok as-is or not.

Thanks.
Comment 10 Karel Srot 2012-10-05 03:59:30 EDT
I agree with Marko, createrepo should not create executable files.

James, can you fix that?
Comment 11 James Antill 2012-10-05 14:13:23 EDT
Yeh, n/p. I just used (0777 ^ umask) without thinking much about it.
Comment 12 Marko Myllynen 2012-10-08 02:35:13 EDT
Thanks, I'm happy to confirm that createrepo-0.9.9-15.el6 works perfectly!
Comment 16 errata-xmlrpc 2013-02-21 03:42:09 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0328.html

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