Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315603 - dispatch-conf doesn't preserve permissions in the archive
Summary: dispatch-conf doesn't preserve permissions in the archive
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Auditing (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-16 13:05 UTC by Kevin Bryan
Modified: 2016-02-17 12:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Bryan 2010-04-16 13:05:19 UTC
Some config files contain sensitive information and have permissions like =u+rw, but when using dispatch-conf (at least with the use-rcs option), the files created in the archive directory seem to be created with the default umask.  Either the original file permissions should be applied, or the archive directory should have at least o-rwx permissions set to disallow all users from being able to browse the config files.

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2011-01-10 13:19:27 UTC
I've looked at the code, and done some basic testing, and it seems to copy the permission bits correctly. This code hasn't changed in years, so it shouldn't matter what version of portage I test with.
Comment 2 Kevin Bryan 2011-01-11 02:35:57 UTC
I think what is happening is that the first time it creates a file in the archive directory it uses the permissions of the source file, but in subsequent runs it doesn't update the permissions if they have changed.  It even says this in the manpage.  Of course, the manpage also suggests setting the permissions of the archive directory appropriately, which I have done (root:root 0750).  Perhaps the manpage for dispatch-conf should mention that.  Or, better, why can't dispatch-conf create the archive-dir with the correct permissions?
Comment 3 Kevin Bryan 2011-01-11 02:38:01 UTC
Sorry, the first two mentions of manpage in the previous comment were to the ci(1) manpage.
Comment 4 Zac Medico gentoo-dev 2011-01-19 19:07:13 UTC
I've restricted the default archive-dir permissions to 700, and added warnings in dispatch-conf.conf and dispatch-conf.1:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ecbdd241f7e8e28f1057781c4ac2013e8d476288
Comment 5 Zac Medico gentoo-dev 2011-01-19 21:01:05 UTC
(In reply to comment #4)
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ecbdd241f7e8e28f1057781c4ac2013e8d476288

This is included in portage-2.1.9.34 and 2.2.0_alpha18.
Comment 6 Aaron Bauman (RETIRED) gentoo-dev 2016-02-17 12:47:59 UTC
Fixed by Portage team or appropriate warnings added.