From: Zac Medico Date: Tue, 19 Jun 2007 09:36:42 +0000 (-0000) Subject: For bug #182428, make quickpkg use a more secure umask by default and allow it to... X-Git-Tag: v2.1.3~210 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=786a04683603c82e0dadf5f5dcbe49b89ad637ea;p=portage.git 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. (trunk r6871) svn path=/main/branches/2.1.2/; revision=6872 --- diff --git a/bin/quickpkg b/bin/quickpkg index 1cce8c340..224f236b2 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -173,11 +173,20 @@ if __name__ == "__main__": usage = "Usage: quickpkg [options] " 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 output import get_term_size, EOutput eout = EOutput() def sigwinch_handler(signum, frame):