* [gentoo-commits] proj/portage:master commit in: bin/, man/
@ 2015-12-08 22:23 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 4+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-12-08 22:23 UTC (permalink / raw
To: gentoo-commits
commit: 2d40eb4b2e484efdd70f04ac237eb699ac54a98e
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec 8 22:18:56 2015 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Dec 8 22:18:56 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=2d40eb4b
egencache: Delete support for deprecated --portdir and --portdir-overlay options.
bin/egencache | 20 +-------------------
man/egencache.1 | 10 +---------
2 files changed, 2 insertions(+), 28 deletions(-)
diff --git a/bin/egencache b/bin/egencache
index ab36bbe..7e3387e 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1,5 +1,5 @@
#!/usr/bin/python -b
-# Copyright 2009-2014 Gentoo Foundation
+# Copyright 2009-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# unicode_literals for compat with TextIOWrapper in Python 2
@@ -113,12 +113,6 @@ def parse_args(args):
common.add_argument("--gpg-key",
help="override the PORTAGE_GPG_KEY variable",
dest="gpg_key")
- common.add_argument("--portdir",
- help="override the PORTDIR variable (deprecated in favor of --repositories-configuration)",
- dest="portdir")
- common.add_argument("--portdir-overlay",
- help="override the PORTDIR_OVERLAY variable (deprecated in favor of --repositories-configuration)",
- dest="portdir_overlay")
common.add_argument("--repositories-configuration",
help="override configuration of repositories (in format of repos.conf)",
dest="repositories_configuration")
@@ -226,13 +220,6 @@ def parse_args(args):
parser.error("Write access denied: --cache-dir='%s'" % \
(options.cache_dir,))
- if options.portdir is not None:
- writemsg_level("egencache: warning: --portdir option is deprecated in favor of --repositories-configuration option\n",
- level=logging.WARNING, noiselevel=-1)
- if options.portdir_overlay is not None:
- writemsg_level("egencache: warning: --portdir-overlay option is deprecated in favor of --repositories-configuration option\n",
- level=logging.WARNING, noiselevel=-1)
-
for atom in args:
try:
atom = portage.dep.Atom(atom)
@@ -949,15 +936,10 @@ def egencache_main(args):
if options.repositories_configuration is not None:
env['PORTAGE_REPOSITORIES'] = options.repositories_configuration
- elif options.portdir_overlay is not None:
- env['PORTDIR_OVERLAY'] = options.portdir_overlay
if options.cache_dir is not None:
env['PORTAGE_DEPCACHEDIR'] = options.cache_dir
- if options.portdir is not None:
- env['PORTDIR'] = options.portdir
-
settings = portage.config(config_root=config_root,
local_config=False, env=env)
diff --git a/man/egencache.1 b/man/egencache.1
index 2465ddf..7fd17c2 100644
--- a/man/egencache.1
+++ b/man/egencache.1
@@ -1,4 +1,4 @@
-.TH "EGENCACHE" "1" "Mar 2015" "Portage VERSION" "Portage"
+.TH "EGENCACHE" "1" "Dec 2015" "Portage VERSION" "Portage"
.SH "NAME"
egencache \- generate metadata cache for ebuild repositories
.SH "SYNOPSIS"
@@ -71,14 +71,6 @@ Also see the related \fB\-\-load\-average\fR option.
.BR \-\-load\-average=LOAD
Specifies that maximum load allowed when spawning multiple jobs.
.TP
-.BR "\-\-portdir=PORTDIR"
-Override the PORTDIR variable. This option is deprecated in favor of
-\-\-repositories\-configuration option.
-.TP
-.BR "\-\-portdir\-overlay=PORTDIR_OVERLAY"
-Override the PORTDIR_OVERLAY variable. This option is deprecated in favor of
-\-\-repositories\-configuration option.
-.TP
.BR "\-\-preserve\-comments"
Preserve the comments found in the output use.local.desc file. This requires
the output file to exist before egencache is called.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, man/
@ 2016-10-27 19:33 Zac Medico
0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2016-10-27 19:33 UTC (permalink / raw
To: gentoo-commits
commit: 98c250cceaf380d6dbeacac90482a5d1956dcb80
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 24 05:10:55 2016 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 19:14:15 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=98c250cc
emerge-webrsync: use gkeys to verify OpenPGP signatures (bug 597918)
Use gkeys to verify OpenPGP signatures by default. Refresh the gentoo
snapshot signing key before signature verification, in order to ensure
that the latest revocation data is available. Add an --insecure option
which disables signature verification. Warn about man-in-the-middle
attacks when the --insecure option is used. Deprecate the pre-existing
webrsync-gpg feature since it requires manual gpg configuration.
X-Gentoo-Bug: 597918
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=597918
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
bin/emerge-webrsync | 51 +++++++++++++++++++++++++++++++++++++++++++++++----
man/make.conf.5 | 6 ++++--
2 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 9961ad8..bdd08e9 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -66,13 +66,24 @@ fi
do_verbose=0
do_debug=0
keep=false
+insecure=false
+
+insecure_bypass_msg() {
+ wecho "The --insecure option can be used to bypass this step."
+ insecure_warning_msg
+}
+
+insecure_warning_msg() {
+ wecho "The --insecure option prevents detection of"
+ wecho "man-in-the-middle attacks!"
+}
if has webrsync-gpg ${FEATURES} ; then
- WEBSYNC_VERIFY_SIGNATURE=1
+ VERIFY_SIGNATURE_LEGACY_MODE=1
else
- WEBSYNC_VERIFY_SIGNATURE=0
+ VERIFY_SIGNATURE_LEGACY_MODE=0
fi
-if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then
+if [ ${VERIFY_SIGNATURE_LEGACY_MODE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then
eecho "please set PORTAGE_GPG_DIR in make.conf"
exit 1
fi
@@ -176,7 +187,7 @@ check_file_signature() {
local file="$2"
local r=1
- if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]; then
+ if [ ${VERIFY_SIGNATURE_LEGACY_MODE} != 0 ]; then
__vecho "Checking signature ..."
@@ -186,6 +197,17 @@ check_file_signature() {
eecho "cannot check signature: gpg binary not found"
exit 1
fi
+ elif ! ${insecure}; then
+ __vecho "Checking signature ..."
+
+ # gkeys requires that the signature file be in the same directory
+ # as the snapshot
+ if [[ ${signature} != ${file}.gpgsig ]]; then
+ # this should not happen
+ eecho "assertion failed: ${signature} != ${file}.gpgsig"
+ exit 1
+ fi
+ gkeys verify -C gentoo -n snapshot -F "${file}" && r=0
else
r=0
fi
@@ -445,6 +467,7 @@ usage() {
Options:
--revert=yyyymmdd Revert to snapshot
+ --insecure Disable OpenPGP signature verification
-k, --keep Keep snapshots in DISTDIR (don't delete)
-q, --quiet Only output errors
-v, --verbose Enable verbose output
@@ -467,6 +490,7 @@ main() {
local v=${arg#*=}
case ${arg} in
-h|--help) usage ;;
+ --insecure) insecure=true ;;
-k|--keep) keep=true ;;
-q|--quiet) PORTAGE_QUIET=1 ;;
-v|--verbose) do_verbose=1 ;;
@@ -512,6 +536,25 @@ main() {
exit 1
fi
+ if ${insecure}; then
+ insecure_warning_msg
+ elif [[ ${VERIFY_SIGNATURE_LEGACY_MODE} == 1 ]]; then
+ wecho "FEATURES=webrsync-gpg is deprecated."
+ wecho "By default, the new gkeys verification mode will be used"
+ wecho "when FEATURES=webrsync-gpg is not enabled."
+ else
+ if ! type -P gkeys >/dev/null; then
+ eecho "gkeys: command not found"
+ eecho "Please try again after installing gkeys: emerge app-crypt/gkeys"
+ insecure_bypass_msg
+ exit 1
+ elif ! gkeys refresh-key -C gentoo -n snapshot; then
+ eecho "gkeys refresh-key failed"
+ insecure_bypass_msg
+ exit 1
+ fi
+ fi
+
[[ ${do_debug} -eq 1 ]] && set -x
if [[ -n ${revert_date} ]] ; then
diff --git a/man/make.conf.5 b/man/make.conf.5
index aea189e..5b809ed 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Feb 2016" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Oct 2016" "Portage VERSION" "Portage"
.SH "NAME"
make.conf \- custom settings for Portage
.SH "SYNOPSIS"
@@ -663,7 +663,9 @@ Portage would have to waste time validating ownership for each and every sync
operation.
.TP
.B webrsync-gpg
-Enable GPG verification when using \fIemerge\-webrsync\fR.
+Enable legacy GPG verification mode when using \fIemerge\-webrsync\fR.
+This feature is deprecated. By default, the new \fBgkeys\fR(1) verification
+mode will be used when this feature is not enabled.
.TP
.B xattr
Preserve extended attributes (filesystem-stored metadata) when installing
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, man/
@ 2016-11-07 21:44 Zac Medico
0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2016-11-07 21:44 UTC (permalink / raw
To: gentoo-commits
commit: 405ab9faa09efd3ee97f83a6c791188162831c75
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 7 21:37:15 2016 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Nov 7 21:43:48 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=405ab9fa
Revert "emerge-webrsync: use gkeys to verify OpenPGP signatures (bug 597918)"
This reverts commit 98c250cceaf380d6dbeacac90482a5d1956dcb80.
We're dropping this patch until a stable release of app-crypt/gkeys
becomes available.
bin/emerge-webrsync | 51 ++++-----------------------------------------------
man/make.conf.5 | 6 ++----
2 files changed, 6 insertions(+), 51 deletions(-)
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index bdd08e9..9961ad8 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -66,24 +66,13 @@ fi
do_verbose=0
do_debug=0
keep=false
-insecure=false
-
-insecure_bypass_msg() {
- wecho "The --insecure option can be used to bypass this step."
- insecure_warning_msg
-}
-
-insecure_warning_msg() {
- wecho "The --insecure option prevents detection of"
- wecho "man-in-the-middle attacks!"
-}
if has webrsync-gpg ${FEATURES} ; then
- VERIFY_SIGNATURE_LEGACY_MODE=1
+ WEBSYNC_VERIFY_SIGNATURE=1
else
- VERIFY_SIGNATURE_LEGACY_MODE=0
+ WEBSYNC_VERIFY_SIGNATURE=0
fi
-if [ ${VERIFY_SIGNATURE_LEGACY_MODE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then
+if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 -a -z "${PORTAGE_GPG_DIR}" ]; then
eecho "please set PORTAGE_GPG_DIR in make.conf"
exit 1
fi
@@ -187,7 +176,7 @@ check_file_signature() {
local file="$2"
local r=1
- if [ ${VERIFY_SIGNATURE_LEGACY_MODE} != 0 ]; then
+ if [ ${WEBSYNC_VERIFY_SIGNATURE} != 0 ]; then
__vecho "Checking signature ..."
@@ -197,17 +186,6 @@ check_file_signature() {
eecho "cannot check signature: gpg binary not found"
exit 1
fi
- elif ! ${insecure}; then
- __vecho "Checking signature ..."
-
- # gkeys requires that the signature file be in the same directory
- # as the snapshot
- if [[ ${signature} != ${file}.gpgsig ]]; then
- # this should not happen
- eecho "assertion failed: ${signature} != ${file}.gpgsig"
- exit 1
- fi
- gkeys verify -C gentoo -n snapshot -F "${file}" && r=0
else
r=0
fi
@@ -467,7 +445,6 @@ usage() {
Options:
--revert=yyyymmdd Revert to snapshot
- --insecure Disable OpenPGP signature verification
-k, --keep Keep snapshots in DISTDIR (don't delete)
-q, --quiet Only output errors
-v, --verbose Enable verbose output
@@ -490,7 +467,6 @@ main() {
local v=${arg#*=}
case ${arg} in
-h|--help) usage ;;
- --insecure) insecure=true ;;
-k|--keep) keep=true ;;
-q|--quiet) PORTAGE_QUIET=1 ;;
-v|--verbose) do_verbose=1 ;;
@@ -536,25 +512,6 @@ main() {
exit 1
fi
- if ${insecure}; then
- insecure_warning_msg
- elif [[ ${VERIFY_SIGNATURE_LEGACY_MODE} == 1 ]]; then
- wecho "FEATURES=webrsync-gpg is deprecated."
- wecho "By default, the new gkeys verification mode will be used"
- wecho "when FEATURES=webrsync-gpg is not enabled."
- else
- if ! type -P gkeys >/dev/null; then
- eecho "gkeys: command not found"
- eecho "Please try again after installing gkeys: emerge app-crypt/gkeys"
- insecure_bypass_msg
- exit 1
- elif ! gkeys refresh-key -C gentoo -n snapshot; then
- eecho "gkeys refresh-key failed"
- insecure_bypass_msg
- exit 1
- fi
- fi
-
[[ ${do_debug} -eq 1 ]] && set -x
if [[ -n ${revert_date} ]] ; then
diff --git a/man/make.conf.5 b/man/make.conf.5
index 5b809ed..aea189e 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Oct 2016" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Feb 2016" "Portage VERSION" "Portage"
.SH "NAME"
make.conf \- custom settings for Portage
.SH "SYNOPSIS"
@@ -663,9 +663,7 @@ Portage would have to waste time validating ownership for each and every sync
operation.
.TP
.B webrsync-gpg
-Enable legacy GPG verification mode when using \fIemerge\-webrsync\fR.
-This feature is deprecated. By default, the new \fBgkeys\fR(1) verification
-mode will be used when this feature is not enabled.
+Enable GPG verification when using \fIemerge\-webrsync\fR.
.TP
.B xattr
Preserve extended attributes (filesystem-stored metadata) when installing
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/, man/
@ 2021-08-18 16:52 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2021-08-18 16:52 UTC (permalink / raw
To: gentoo-commits
commit: 875c8dbcc6e9c98d289ec1869c61fbcc4da5864c
Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 29 08:54:19 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug 18 16:52:30 2021 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=875c8dbc
pid-ns-init: Consider autogroup scheduling
With Linux's autogroup scheduling feature (CONFIG_SCHED_AUTOGROUP)
setting a nice value on a per-process base has only an effect for
scheduling decisions relative to the other threads in the same
session (typically: the same terminal window). See the section "The
nice value and group scheduling" in the sched(7) man page.
Basically this means that portage "just" setting the nice value, has
no effect in presence of autogroup scheduling being active (which is
probably true for most (desktop) user systems).
This commit changes pid-ns-init to set the autogroup's nice value in
case autogroups are present (detected by the existence of
/proc/self/autogroup).
My initial attempt to consider autogroup scheduling revolved around
nice() in actions.py setting the autogroup nice value and restoring
the original value with an atexit handler. See
055abe523c2c ("PORTAGE_NICENESS: Consider autogroup
scheduling"). However this is fragile if the performing process is
unprivileged (think of a user calling "ebuild foo-1.0.0.ebuild
manifest") as Linux employs a rate limiting to autogroup changes by
unprivileged processes [1].
Eventually this means portage can only reliable set the autogroup
value within the pid-ns-init helper, where a new session is
created. We only set the autogroup value within the new session, which
relieves portage from restoring the original value, as the autogroup
will cease to exist once the session exists, i.e. with the termination
of the pid-ns-init helper.
Note that the pid-ns-init helper is an optional portage feature
'pid-sandbox'. Only if this is enabled, portage will set the
autogroup's nice value.
1: https://github.com/torvalds/linux/blob/fd0aa1a4567d0f09e1bfe367a950b004f99ac290/kernel/sched/autogroup.c#L226-L227
Bug: https://bugs.gentoo.org/777492
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/728
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
bin/pid-ns-init | 20 +++++++++++++++++++-
man/make.conf.5 | 5 ++++-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/bin/pid-ns-init b/bin/pid-ns-init
index e410dd028..1c5125185 100644
--- a/bin/pid-ns-init
+++ b/bin/pid-ns-init
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright 2018-2020 Gentoo Authors
+# Copyright 2018-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import errno
@@ -12,6 +12,7 @@ import subprocess
import sys
import termios
+from pathlib import Path
KILL_SIGNALS = (
signal.SIGINT,
@@ -91,9 +92,26 @@ def main(argv):
'preexec_fn': functools.partial(preexec_fn, uid, gid, groups, umask),
'pass_fds': pass_fds,
}
+
+ # Obtain the current nice value, which will be potentially be
+ # used as the newly created session's autogroup nice value.
+ nice_value = os.nice(0)
+
# Isolate parent process from process group SIGSTOP (bug 675870)
setsid = True
os.setsid()
+
+ # Set the previously obtained autogroup nice value again,
+ # since we created a new session with os.setsid() above.
+ try:
+ Path("/proc/self/autogroup").write_text(str(nice_value))
+ except EnvironmentError as e:
+ # The process is likely not allowed to set the autogroup
+ # value (Linux employs a rate limiting for unprivileged
+ # changes to the autogroup value) or autogroups are not
+ # enabled. Nothing we can do here, so we simply carry on.
+ pass
+
if sys.stdout.isatty():
try:
fcntl.ioctl(sys.stdout, termios.TIOCSCTTY, 0)
diff --git a/man/make.conf.5 b/man/make.conf.5
index db742fdb5..0790933f7 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "May 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Jun 2021" "Portage VERSION" "Portage"
.SH "NAME"
make.conf \- custom settings for Portage
.SH "SYNOPSIS"
@@ -993,6 +993,9 @@ string should contain a \\${PID} place-holder that will be substituted
with an integer pid. For example, a value of "ionice \-c 3 \-p \\${PID}"
will set idle io priority. For more information about ionice, see
\fBionice\fR(1). This variable is unset by default.
+.br
+Portage will also set the autogroup-nice value (see fBsched\fR(7))), if
+FEATURES="pid\-sandbox" is enabled.
.TP
.B PORTAGE_LOG_FILTER_FILE_CMD
This variable specifies a command that filters build log output to a
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-18 16:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08 22:23 [gentoo-commits] proj/portage:master commit in: bin/, man/ Arfrever Frehtes Taifersar Arahesis
-- strict thread matches above, loose matches on Subject: below --
2016-10-27 19:33 Zac Medico
2016-11-07 21:44 Zac Medico
2021-08-18 16:52 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox