Bug 833350 - Tempfile ignores umask for files created in createrepo cache.
Summary: Tempfile ignores umask for files created in createrepo cache.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: createrepo
Version: 6.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-19 09:36 UTC by Marko Myllynen
Modified: 2013-02-21 08:42 UTC (History)
0 users

Fixed In Version: createrepo-0.9.9-15.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1686812 (view as bug list)
Environment:
Last Closed: 2013-02-21 08:42:09 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0328 normal SHIPPED_LIVE createrepo bug fix and enhancement update 2013-02-20 20:54:31 UTC

Description Marko Myllynen 2012-06-19 09:36:35 UTC
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 14:38:33 UTC
> 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 Program Management 2012-07-10 06:02:05 UTC
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 Program Management 2012-07-10 23:11:03 UTC
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 Program Management 2012-08-14 21:59:20 UTC
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 08:52:59 UTC
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 07:18:20 UTC
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 07:59:30 UTC
I agree with Marko, createrepo should not create executable files.

James, can you fix that?

Comment 11 James Antill 2012-10-05 18:13:23 UTC
Yeh, n/p. I just used (0777 ^ umask) without thinking much about it.

Comment 12 Marko Myllynen 2012-10-08 06:35:13 UTC
Thanks, I'm happy to confirm that createrepo-0.9.9-15.el6 works perfectly!

Comment 16 errata-xmlrpc 2013-02-21 08:42:09 UTC
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.