diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-19 09:35:56 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-19 09:35:56 +0000 |
commit | bd1eb50db206dd721b16dd8e080f2d2d512d53f3 (patch) | |
tree | 116e5e12f0c6454fafb5e3216ce0cb6af5931a70 /bin/quickpkg | |
parent | Add a test case for the logfile functionality of portage.spawn(). (diff) | |
download | portage-idfetch-bd1eb50db206dd721b16dd8e080f2d2d512d53f3.tar.gz portage-idfetch-bd1eb50db206dd721b16dd8e080f2d2d512d53f3.tar.bz2 portage-idfetch-bd1eb50db206dd721b16dd8e080f2d2d512d53f3.zip |
For bug #182428, make quickpkg use a more secure umask by default and allow it to be overridden by a --umask option. Add support for QUICKPKG_DEFAULT_OPTS so that default options can be set in make.conf.
svn path=/main/trunk/; revision=6871
Diffstat (limited to 'bin/quickpkg')
-rwxr-xr-x | bin/quickpkg | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/quickpkg b/bin/quickpkg index cf8c44c4..7abcec6d 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -121,11 +121,20 @@ if __name__ == "__main__": usage = "Usage: quickpkg [options] <list of package atoms>" from optparse import OptionParser parser = OptionParser(usage=usage) - options, args = parser.parse_args(sys.argv[1:]) + parser.add_option("--umask", + default="0077", + help="umask used during package creation (default is 0077)") + from portage import settings + default_opts = settings.get("QUICKPKG_DEFAULT_OPTS","").split() + options, args = parser.parse_args(default_opts + sys.argv[1:]) if not args: parser.error("no packages atoms given") + try: + umask = int(options.umask, 8) + except ValueError: + parser.error("invalid umask: %s" % options.umask) # We need to ensure a sane umask for the packages that will be created. - old_umask = os.umask(022) + old_umask = os.umask(umask) from portage.output import get_term_size, EOutput eout = EOutput() def sigwinch_handler(signum, frame): |