poldek --mkidx does not respect umask

Bug #1644315 reported by Elan Ruusamäe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
poldek
Fix Committed
Medium
Marcin Banasiak

Bug Description

poldek --mkidx does not respect umask:

i've set umask to 002 so files are group writable, but poldek writes with hardcoded 644:

-rw-r--r-- 1 gitlab-runner gitlab-runner 704 nov 23 19:15 packages.ndir.dscr.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 316 nov 23 19:15 packages.ndir.dscr.i18n.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 1,4K nov 23 19:15 packages.ndir.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 50 nov 23 19:15 packages.ndir.md

so i've chmod g+rw the files, and run index again:

drwxr-sr-x 2 gitlab-runner gitlab-runner 220 nov 23 19:20 packages.i/
-rw-rw-r-- 1 gitlab-runner gitlab-runner 705 nov 23 19:20 packages.ndir.dscr.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 32 nov 23 19:20 packages.ndir.dscr.gz.md5
-rw-rw-r-- 1 gitlab-runner gitlab-runner 316 nov 23 19:20 packages.ndir.dscr.i18n.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 32 nov 23 19:20 packages.ndir.dscr.i18n.gz.md5
-rw-rw-r-- 1 gitlab-runner gitlab-runner 1,4K nov 23 19:20 packages.ndir.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 32 nov 23 19:20 packages.ndir.gz.md5
-rw-r--r-- 1 gitlab-runner gitlab-runner 40 nov 23 19:20 packages.ndir.md

it has reset some, and yet packages.i created with it's own force:

$ ls -l packages.i
total 20K
-rw-r--r-- 1 gitlab-runner gitlab-runner 1,4K nov 23 19:20 packages.ndir.2016.11.23-17.15.49.gz
-rw-rw-r-- 1 gitlab-runner gitlab-runner 102 nov 23 19:20 packages.ndir.diff.toc.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 102 nov 23 19:20 packages.ndir.diff.toc.gz-
-rw-r--r-- 1 gitlab-runner gitlab-runner 705 nov 23 19:20 packages.ndir.dscr.2016.11.23-17.15.49.gz
-rw-r--r-- 1 gitlab-runner gitlab-runner 316 nov 23 19:20 packages.ndir.dscr.i18n.2016.11.23-17.15.49.gz

please add support for overriding, because i can't chmod g+rw after each run, because if the file was created by some other user there is not permitted to change permissions of other user files without root privilege

i'd say respect umask, but some --filemode=0664 option is fine as well.

Changed in poldek:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Marcin Banasiak (megabajt)
Revision history for this message
Marcin Banasiak (megabajt) wrote :
Changed in poldek:
status: In Progress → Fix Committed
Revision history for this message
Elan Ruusamäe (glen666) wrote :

so rpmReadConfigFiles side effect is that it modifies umask?

Revision history for this message
Marcin Banasiak (megabajt) wrote :

Yes, it resets umask to 0022. See http://rpm5.org/cvs/fileview?f=rpm/lib/rpmrc.c&v=2.289.4.12

And as I see this behaviour is present only in rpm5. rpm.org has already fixed it some time ago in https://github.com/rpm-software-management/rpm/commit/b270b38a70518ecb3f9d5a6ccb691fd619f53196

Revision history for this message
Elan Ruusamäe (glen666) wrote :

i suggest to fix our rpm as well.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.