Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
afc84d0
app-admin/logrotate: Sync with Gentoo
Oct 19, 2026
8c53ce4
app-admin/sudo: Sync with Gentoo
Oct 19, 2026
d339bf0
app-arch/gzip: Sync with Gentoo
Oct 19, 2026
615e64a
app-arch/libarchive: Sync with Gentoo
Oct 19, 2026
5e2a7d9
app-arch/xz-utils: Sync with Gentoo
Oct 19, 2026
11d3e84
app-containers/conmon: Sync with Gentoo
Oct 19, 2026
a1f8d0e
app-containers/containerd: Sync with Gentoo
Oct 19, 2026
29a769a
app-containers/containers-shortnames: Sync with Gentoo
Oct 19, 2026
18d57cb
app-containers/docker: Sync with Gentoo
Oct 19, 2026
fef67e3
app-containers/docker-buildx: Sync with Gentoo
Oct 19, 2026
db08167
app-containers/docker-cli: Sync with Gentoo
Oct 19, 2026
2ddc08e
app-containers/incus: Sync with Gentoo
Oct 19, 2026
9f80860
app-containers/podman: Sync with Gentoo
Oct 19, 2026
b9f512f
app-containers/runc: Sync with Gentoo
Oct 19, 2026
6775b19
app-crypt/ccid: Sync with Gentoo
Oct 19, 2026
e161db5
app-crypt/gnupg: Sync with Gentoo
Oct 19, 2026
2272e7b
app-crypt/gpgme: Sync with Gentoo
Oct 19, 2026
6fb88d8
app-crypt/mit-krb5: Sync with Gentoo
Oct 19, 2026
b7a3051
app-crypt/tpm2-tools: Sync with Gentoo
Oct 19, 2026
29577f0
app-doc/eclass-manpages: Sync with Gentoo
Oct 19, 2026
59e68fe
app-editors/vim: Sync with Gentoo
Oct 19, 2026
528aa99
app-editors/vim-core: Sync with Gentoo
Oct 19, 2026
350d460
app-emulation/qemu: Sync with Gentoo
Oct 19, 2026
be91eed
app-eselect/eselect-pinentry: Sync with Gentoo
Oct 19, 2026
c653384
app-misc/pax-utils: Sync with Gentoo
Oct 19, 2026
1f38ecf
app-portage/elt-patches: Sync with Gentoo
Oct 19, 2026
aa8c7ff
app-portage/gemato: Sync with Gentoo
Oct 19, 2026
07d7327
app-portage/gentoolkit: Sync with Gentoo
Oct 19, 2026
66ca267
app-shells/bash: Sync with Gentoo
Oct 19, 2026
7d3e209
app-shells/gentoo-bashcomp: Sync with Gentoo
Oct 19, 2026
fa14360
app-vim/gentoo-syntax: Sync with Gentoo
Oct 19, 2026
7e8f184
dev-build/autoconf: Sync with Gentoo
Oct 19, 2026
6061851
dev-build/automake: Sync with Gentoo
Oct 19, 2026
9f93dc8
dev-build/automake-wrapper: Sync with Gentoo
Oct 19, 2026
6f2d3c2
dev-build/cmake: Sync with Gentoo
Oct 19, 2026
aa00891
dev-build/libtool: Sync with Gentoo
Oct 19, 2026
163da4d
dev-build/meson: Sync with Gentoo
Oct 19, 2026
2a49471
dev-build/ninja: Sync with Gentoo
Oct 19, 2026
87fe4a0
dev-db/sqlite: Sync with Gentoo
Oct 19, 2026
01d5b6d
dev-debug/gdb: Sync with Gentoo
Oct 19, 2026
0e42765
dev-debug/strace: Sync with Gentoo
Oct 19, 2026
ffbce6e
dev-lang/go: Sync with Gentoo
Oct 19, 2026
50270d7
dev-lang/perl: Sync with Gentoo
Oct 19, 2026
320f37b
dev-lang/python: Sync with Gentoo
Oct 19, 2026
4fa27b9
dev-lang/rust: Sync with Gentoo
Oct 19, 2026
da850c2
dev-lang/rust-bin: Sync with Gentoo
Oct 19, 2026
6c3a35a
dev-lang/rust-common: Sync with Gentoo
Oct 19, 2026
4d28cd5
dev-lang/swig: Sync with Gentoo
Oct 19, 2026
7717456
dev-libs/blake3: Sync with Gentoo
Oct 19, 2026
0a8ec7f
dev-libs/elfutils: Sync with Gentoo
Oct 19, 2026
92f6e72
dev-libs/expat: Sync with Gentoo
Oct 19, 2026
15b437e
dev-libs/gmp: Sync with Gentoo
Oct 19, 2026
d3886c9
dev-libs/libksba: Sync with Gentoo
Oct 19, 2026
919ee5c
dev-libs/libltdl: Sync with Gentoo
Oct 19, 2026
b7cc233
dev-libs/libp11: Sync with Gentoo
Oct 19, 2026
14ad203
dev-libs/libpcre2: Sync with Gentoo
Oct 19, 2026
651bd46
dev-libs/libusb: Sync with Gentoo
Oct 19, 2026
b9b5bf8
dev-libs/libuv: Sync with Gentoo
Oct 19, 2026
ee1be25
dev-libs/libxml2: Sync with Gentoo
Oct 19, 2026
b9a2317
dev-libs/mpc: Sync with Gentoo
Oct 19, 2026
b534387
dev-libs/mpfr: Sync with Gentoo
Oct 19, 2026
de746ee
dev-libs/tree-sitter: Sync with Gentoo
Oct 19, 2026
75621bd
dev-libs/xmlsec: Sync with Gentoo
Oct 19, 2026
9ecd4bc
dev-python/charset-normalizer: Sync with Gentoo
Oct 19, 2026
676b3fb
dev-python/crcmod: Sync with Gentoo
Oct 19, 2026
b8f2289
dev-python/cryptography: Sync with Gentoo
Oct 19, 2026
4fa0918
dev-python/cython: Sync with Gentoo
Oct 19, 2026
ef1cf8e
dev-python/dependency-groups: Sync with Gentoo
Oct 19, 2026
c8de030
dev-python/distlib: Sync with Gentoo
Oct 19, 2026
4d58346
dev-python/editables: Sync with Gentoo
Oct 19, 2026
5fdd772
dev-python/ensurepip-pip: Sync with Gentoo
Oct 19, 2026
3d4dbe9
dev-python/fastjsonschema: Sync with Gentoo
Oct 19, 2026
e2ad9ae
dev-python/flit-core: Sync with Gentoo
Oct 19, 2026
db6a76b
dev-python/gpep517: Sync with Gentoo
Oct 19, 2026
adc485f
dev-python/hatch-vcs: Sync with Gentoo
Oct 19, 2026
652f1b5
dev-python/hatchling: Sync with Gentoo
Oct 19, 2026
562da2b
dev-python/idna: Sync with Gentoo
Oct 19, 2026
239023a
dev-python/installer: Sync with Gentoo
Oct 19, 2026
9bc981b
dev-python/jaraco-collections: Sync with Gentoo
Oct 19, 2026
e823f19
dev-python/jaraco-context: Sync with Gentoo
Oct 19, 2026
e8996d8
dev-python/jaraco-functools: Sync with Gentoo
Oct 19, 2026
d2696c3
dev-python/jaraco-text: Sync with Gentoo
Oct 19, 2026
63318a4
dev-python/lazy-object-proxy: Sync with Gentoo
Oct 19, 2026
73ce54b
dev-python/linkify-it-py: Sync with Gentoo
Oct 19, 2026
a31ddeb
dev-python/lxml: Sync with Gentoo
Oct 19, 2026
7dd226b
dev-python/markupsafe: Sync with Gentoo
Oct 19, 2026
07227ca
dev-python/more-itertools: Sync with Gentoo
Oct 19, 2026
feddb2e
dev-python/msgpack: Sync with Gentoo
Oct 19, 2026
1357af7
dev-python/packaging: Sync with Gentoo
Oct 19, 2026
ff853ef
dev-python/pathspec: Sync with Gentoo
Oct 19, 2026
00e98cb
dev-python/pip: Sync with Gentoo
Oct 19, 2026
85a9d57
dev-python/platformdirs: Sync with Gentoo
Oct 19, 2026
368911f
dev-python/pluggy: Sync with Gentoo
Oct 19, 2026
5684c40
dev-python/poetry-core: Sync with Gentoo
Oct 19, 2026
ae93bd8
dev-python/pycparser: Sync with Gentoo
Oct 19, 2026
f4a6bea
dev-python/pygments: Sync with Gentoo
Oct 19, 2026
c6b80e8
dev-python/pyproject-hooks: Sync with Gentoo
Oct 19, 2026
e2b66e3
dev-python/setuptools: Sync with Gentoo
Oct 19, 2026
5083bad
dev-python/setuptools-scm: Sync with Gentoo
Oct 19, 2026
4c243e7
dev-python/six: Sync with Gentoo
Oct 19, 2026
e0c97d7
dev-python/snakeoil: Sync with Gentoo
Oct 19, 2026
39bbdc3
dev-python/tomli: Sync with Gentoo
Oct 19, 2026
63f8c9c
dev-python/tomli-w: Sync with Gentoo
Oct 19, 2026
7558954
dev-python/tomlkit: Sync with Gentoo
Oct 19, 2026
c7535d9
dev-python/tree-sitter: Sync with Gentoo
Oct 19, 2026
f8fafd2
dev-python/trove-classifiers: Sync with Gentoo
Oct 19, 2026
8d579b0
dev-python/truststore: Sync with Gentoo
Oct 19, 2026
accb805
dev-python/typing-extensions: Sync with Gentoo
Oct 19, 2026
6761194
dev-python/urllib3: Sync with Gentoo
Oct 19, 2026
24490ff
dev-python/vcs-versioning: Sync with Gentoo
Oct 19, 2026
327529d
dev-python/wheel: Sync with Gentoo
Oct 19, 2026
d127988
dev-util/maturin: Sync with Gentoo
Oct 19, 2026
090b724
dev-util/pahole: Sync with Gentoo
Oct 19, 2026
5d832f2
dev-util/patchelf: Sync with Gentoo
Oct 19, 2026
5f4771b
dev-util/pkgcheck: Sync with Gentoo
Oct 19, 2026
8f17740
dev-util/xdelta: Sync with Gentoo
Oct 19, 2026
5469a01
dev-vcs/git: Sync with Gentoo
Oct 19, 2026
1d8e338
eclass/acct-group: Sync with Gentoo
Oct 19, 2026
fa14927
eclass/acct-user: Sync with Gentoo
Oct 19, 2026
d85baff
eclass/autotools: Sync with Gentoo
Oct 19, 2026
55698fe
eclass/cargo: Sync with Gentoo
Oct 19, 2026
1576888
eclass/distutils-r1: Sync with Gentoo
Oct 19, 2026
cb20808
eclass/edo: Sync with Gentoo
Oct 19, 2026
e673653
eclass/python-utils-r1: Sync with Gentoo
Oct 19, 2026
d5c5b4e
eclass/qmake-utils: Sync with Gentoo
Oct 19, 2026
8299eaf
eclass/rust: Sync with Gentoo
Oct 19, 2026
6a97e96
eclass/shell-completion: Sync with Gentoo
Oct 19, 2026
0eb28f4
eclass/toolchain: Sync with Gentoo
Oct 19, 2026
a1a9cc0
eclass/tree-sitter-grammar: Sync with Gentoo
Oct 19, 2026
881c9ed
eclass/verify-sig: Sync with Gentoo
Oct 19, 2026
09de4eb
licenses: Sync with Gentoo
Oct 19, 2026
78e5d3e
media-libs/libpng: Sync with Gentoo
Oct 19, 2026
af64713
net-analyzer/tcpdump: Sync with Gentoo
Oct 19, 2026
48809ce
net-dns/bind: Sync with Gentoo
Oct 19, 2026
5bd03a7
net-dns/dnsmasq: Sync with Gentoo
Oct 19, 2026
749f01e
net-firewall/ipset: Sync with Gentoo
Oct 19, 2026
cd563c1
net-firewall/nftables: Sync with Gentoo
Oct 19, 2026
c367826
net-fs/cifs-utils: Sync with Gentoo
Oct 19, 2026
ab31140
net-fs/nfs-utils: Sync with Gentoo
Oct 19, 2026
cd356ef
net-fs/samba: Sync with Gentoo
Oct 19, 2026
ba432c6
net-libs/libnftnl: Sync with Gentoo
Oct 19, 2026
a415b86
net-libs/libpcap: Sync with Gentoo
Oct 19, 2026
fdce817
net-libs/libpsl: Sync with Gentoo
Oct 19, 2026
b86dde6
net-libs/nghttp2: Sync with Gentoo
Oct 19, 2026
a8eafc5
net-libs/ngtcp2: Sync with Gentoo
Oct 19, 2026
b1e0d82
net-misc/chrony: Sync with Gentoo
Oct 19, 2026
e64262e
net-misc/curl: Sync with Gentoo
Oct 19, 2026
71c2a37
net-misc/iperf: Sync with Gentoo
Oct 19, 2026
e2734cd
net-misc/openssh: Sync with Gentoo
Oct 19, 2026
b84049b
net-misc/passt: Sync with Gentoo
Oct 19, 2026
fa54bef
net-misc/rsync: Sync with Gentoo
Oct 19, 2026
df7ff33
net-misc/wget: Sync with Gentoo
Oct 19, 2026
f72a89a
net-vpn/wireguard-tools: Sync with Gentoo
Oct 19, 2026
9580647
profiles: Sync with Gentoo
Oct 19, 2026
776d5df
sec-policy/selinux-base: Sync with Gentoo
Oct 19, 2026
6f340fb
sec-policy/selinux-base-policy: Sync with Gentoo
Oct 19, 2026
f4e9c4d
sec-policy/selinux-container: Sync with Gentoo
Oct 19, 2026
e16ae04
sec-policy/selinux-dbus: Sync with Gentoo
Oct 19, 2026
dbb3140
sec-policy/selinux-policykit: Sync with Gentoo
Oct 19, 2026
c16378c
sec-policy/selinux-sssd: Sync with Gentoo
Oct 19, 2026
6c4369e
sec-policy/selinux-unconfined: Sync with Gentoo
Oct 19, 2026
20b2bb4
sys-apps/bubblewrap: Sync with Gentoo
Oct 19, 2026
d165414
sys-apps/busybox: Sync with Gentoo
Oct 19, 2026
16eb7b5
sys-apps/coreutils: Sync with Gentoo
Oct 19, 2026
b05f1d0
sys-apps/dbus: Sync with Gentoo
Oct 19, 2026
c032653
sys-apps/groff: Sync with Gentoo
Oct 19, 2026
c8f4c87
sys-apps/iproute2: Sync with Gentoo
Oct 19, 2026
f8df24d
sys-apps/less: Sync with Gentoo
Oct 19, 2026
0bf9a9b
sys-apps/man-pages: Sync with Gentoo
Oct 19, 2026
f7250f8
sys-apps/pcsc-lite: Sync with Gentoo
Oct 19, 2026
2eaf267
sys-apps/pkgcore: Sync with Gentoo
Oct 19, 2026
9720902
sys-apps/portage: Sync with Gentoo
Oct 19, 2026
eddef32
sys-apps/pv: Sync with Gentoo
Oct 19, 2026
42a0f76
sys-apps/shadow: Sync with Gentoo
Oct 19, 2026
9bcaef4
sys-apps/systemd: Sync with Gentoo
Oct 19, 2026
f848182
sys-apps/util-linux: Sync with Gentoo
Oct 19, 2026
06fc946
sys-auth/pambase: Sync with Gentoo
Oct 19, 2026
c9bd346
sys-auth/sssd: Sync with Gentoo
Oct 19, 2026
68b129b
sys-block/thin-provisioning-tools: Sync with Gentoo
Oct 19, 2026
2f5ef43
sys-boot/grub: Sync with Gentoo
Oct 19, 2026
b8dd207
sys-devel/binutils: Sync with Gentoo
Oct 19, 2026
e194daa
sys-devel/crossdev: Sync with Gentoo
Oct 19, 2026
ef073a1
sys-devel/dwz: Sync with Gentoo
Oct 19, 2026
a3cfc0f
sys-devel/gcc: Sync with Gentoo
Oct 19, 2026
0f6416f
sys-firmware/intel-microcode: Sync with Gentoo
Oct 19, 2026
e0b970a
sys-fs/cryptsetup: Sync with Gentoo
Oct 19, 2026
a0c1080
sys-fs/fuse: Sync with Gentoo
Oct 19, 2026
5097532
sys-fs/inotify-tools: Sync with Gentoo
Oct 19, 2026
e49b072
sys-fs/xfsprogs: Sync with Gentoo
Oct 19, 2026
f670a3e
sys-libs/binutils-libs: Sync with Gentoo
Oct 19, 2026
c742d1f
sys-libs/glibc: Sync with Gentoo
Oct 19, 2026
828d227
sys-libs/libcap-ng: Sync with Gentoo
Oct 19, 2026
09610ef
sys-libs/libunwind: Sync with Gentoo
Oct 19, 2026
6540730
sys-libs/liburing: Sync with Gentoo
Oct 19, 2026
a6772cb
sys-libs/libxcrypt: Sync with Gentoo
Oct 19, 2026
9799ef6
sys-libs/ncurses: Sync with Gentoo
Oct 19, 2026
864ca9e
sys-libs/readline: Sync with Gentoo
Oct 19, 2026
da6d90a
sys-libs/talloc: Sync with Gentoo
Oct 19, 2026
e015e8e
sys-libs/tevent: Sync with Gentoo
Oct 19, 2026
c03df7d
sys-libs/timezone-data: Sync with Gentoo
Oct 19, 2026
ea5e512
sys-process/audit: Sync with Gentoo
Oct 19, 2026
1fbc791
sys-process/procps: Sync with Gentoo
Oct 19, 2026
e7b7afb
virtual/acl: Sync with Gentoo
Oct 19, 2026
2552bb4
virtual/editor: Sync with Gentoo
Oct 19, 2026
9bbcc8b
virtual/libpcre2-internals: Sync with Gentoo
Oct 19, 2026
b6b2259
virtual/perl-Encode: Sync with Gentoo
Oct 19, 2026
fa30b55
virtual/perl-ExtUtils-MakeMaker: Sync with Gentoo
Oct 19, 2026
f0eff0f
virtual/tmpfiles: Sync with Gentoo
Oct 19, 2026
44b935a
x11-drivers/nvidia-drivers: Sync with Gentoo
Oct 19, 2026
d49f1a6
x11-misc/makedepend: Sync with Gentoo
Oct 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else
SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.xz"
SRC_URI+=" verify-sig? ( https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.xz.asc )"

KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"

BDEPEND="verify-sig? ( sec-keys/openpgp-keys-cgzones )"
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/src/sudo.c b/src/sudo.c
index 0ed053839..89d97b6e8 100644
--- a/src/sudo.c
+++ b/src/sudo.c
@@ -341,13 +341,48 @@ access_denied:
return EXIT_FAILURE;
}

+/*
+ * Set the time zone using tzset(3), removing the user's TZ
+ * environment variable. The original value of TZ may still
+ * be present in the command's environment, depending on sudoers.
+ */
+static void
+set_time_zone(void)
+{
+ /* Use system time zone, not user-specified. */
+ unsetenv("TZ");
+ (void) tzset();
+}
+
int
os_init_common(int argc, char *argv[], char *envp[])
{
+ extern char **environ;
+ int envc;
#ifdef STATIC_SUDOERS_PLUGIN
preload_static_symbols();
#endif
gc_init();
+
+ /*
+ * Make a copy of environ[] that is distinct from envp[].
+ * This allows us to remove variables from sudo's environment
+ * while still providing the original envp to the plugins.
+ */
+ for (envc = 0; envp[envc] != NULL; envc++)
+ continue;
+ if (envc != 0) {
+ char **new_env = reallocarray(NULL, sizeof(char *), envc + 1);
+ if (new_env == NULL || !gc_add(GC_PTR, new_env)) {
+ sudo_fatalx_nodebug(U_("%s: %s"), __func__,
+ U_("unable to allocate memory"));
+ }
+ for (envc = 0; envp[envc] != NULL; envc++)
+ new_env[envc] = envp[envc];
+ new_env[envc] = NULL;
+ environ = new_env;
+ }
+
return 0;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit pam tmpfiles toolchain-funcs

MY_P="${P/_/}"
MY_P="${MY_P/beta/b}"

DESCRIPTION="Allows users or groups to run commands as other users"
HOMEPAGE="https://www.sudo.ws/"

if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="
https://github.com/sudo-project/sudo
https://git.sudo.ws/sudo
"
inherit autotools git-r3
else
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/sudo.ws.asc
inherit libtool verify-sig

uri_prefix=
case ${P} in
*_beta*|*_rc*) uri_prefix=beta/ ;;
esac

SRC_URI="
https://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
verify-sig? (
https://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz.sig
)
"

if [[ ${PV} != *_beta* && ${PV} != *_rc* ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi

BDEPEND="verify-sig? ( sec-keys/openpgp-keys-sudo )"
fi

S="${WORKDIR}/${MY_P}"

# Basic license is ISC-style as-is, some files are released under
# 3-clause BSD license
LICENSE="ISC BSD"
SLOT="0"
IUSE="gcrypt ldap nls offensive pam sasl +secure-path selinux +sendmail skey ssl sssd"

DEPEND="
virtual/zlib:=
virtual/libcrypt:=
gcrypt? ( dev-libs/libgcrypt:= )
ldap? (
>=net-nds/openldap-2.1.30-r1:=
sasl? (
dev-libs/cyrus-sasl
net-nds/openldap:=[sasl]
)
)
pam? ( sys-libs/pam )
sasl? ( dev-libs/cyrus-sasl )
selinux? ( sys-libs/libselinux )
skey? ( >=sys-auth/skey-1.1.5-r1 )
ssl? ( dev-libs/openssl:= )
sssd? ( sys-auth/sssd[sudo(+)] )
"
RDEPEND="
${DEPEND}
>=app-misc/editor-wrapper-3
virtual/editor
ldap? ( dev-lang/perl )
pam? ( sys-auth/pambase )
selinux? ( sec-policy/selinux-sudo )
sendmail? ( virtual/mta )
"
BDEPEND+="
app-alternatives/yacc
virtual/pkgconfig
"

REQUIRED_USE="
?? ( pam skey )
?? ( gcrypt ssl )
"

MAKEOPTS+=" SAMPLES="

PATCHES=(
"${FILESDIR}/CVE-2026-96512.patch"
)

src_prepare() {
default

if [[ ${PV} == 9999 ]] ; then
eautoreconf
else
elibtoolize
fi
}

set_secure_path() {
# First extract the default ROOTPATH from build env
SECURE_PATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}")

case "${SECURE_PATH}" in
*/usr/sbin*)
;;
*)
SECURE_PATH=$(unset PATH; . "${EPREFIX}"/etc/profile.env; echo "${PATH}")
;;
esac

if [[ -z ${SECURE_PATH} ]] ; then
ewarn " Failed to detect SECURE_PATH, please report this"
fi

# Then remove duplicate path entries
cleanpath() {
local newpath thisp IFS=:
for thisp in $1 ; do
if [[ :${newpath}: != *:${thisp}:* ]] ; then
newpath+=:${thisp}
else
einfo " Duplicate entry ${thisp} removed..."
fi
done
SECURE_PATH=${newpath#:}
}
cleanpath /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin${SECURE_PATH:+:${SECURE_PATH}}

# Finally, strip gcc paths, bug #136027
rmpath() {
local e newpath thisp IFS=:
for thisp in ${SECURE_PATH} ; do
for e ; do
[[ ${thisp} == ${e} ]] && continue 2 ;
done
newpath+=:${thisp}
done
SECURE_PATH=${newpath#:}
}
rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*'
}

src_configure() {
local SECURE_PATH

set_secure_path

# bug #767712
tc-export PKG_CONFIG

# - audit: somebody got to explain me how I can test this before I
# enable it.. - Diego
# - plugindir: autoconf code is crappy and does not delay evaluation
# until `make` time, so we have to use a full path here rather than
# basing off other values.
local myeconfargs=(
# We set all of the relevant options by ourselves (patched
# into the toolchain) and setting these in the build system
# actually causes a downgrade when using e.g. -D_FORTIFY_SOURCE=3
# (it'll downgrade to =2). So, this has no functional effect on
# the hardening for users. It's safe.
--disable-hardening

# requires some python eclass
--disable-python
--enable-tmpfiles.d="${EPREFIX}"/usr/lib/tmpfiles.d
--enable-zlib=system
--with-editor="${EPREFIX}"/usr/libexec/editor
--with-env-editor
--with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo
--with-rundir="${EPREFIX}"/run/sudo
--with-vardir="${EPREFIX}"/var/db/sudo
--without-linux-audit
--without-opie
$(use_enable gcrypt)
$(use_enable nls)
$(use_enable sasl)
$(use_enable ssl openssl)
$(use_with ldap)
$(use_with ldap ldap_conf_file /etc/ldap.conf.sudo)
$(use_with offensive insults)
$(use_with offensive all-insults)
$(use_with pam)
$(use_with pam pam-login)
$(use_with secure-path)
"$(use_with secure-path secure-path-value "${SECURE_PATH}")"
$(use_with selinux)
$(use_with sendmail)
$(use_with skey)
$(use_with sssd)
)

econf "${myeconfargs[@]}"
}

src_install() {
default

if use ldap ; then
dodoc README.LDAP.md

cat <<-EOF > "${T}"/ldap.conf.sudo
# See ldap.conf(5) and README.LDAP.md for details
# This file should only be readable by root

# supported directives: host, port, ssl, ldap_version
# uri, binddn, bindpw, sudoers_base, sudoers_debug
# tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key}
EOF

if use sasl ; then
cat <<-EOF >> "${T}"/ldap.conf.sudo

# SASL directives: use_sasl, sasl_mech, sasl_auth_id
# sasl_secprops, rootuse_sasl, rootsasl_auth_id, krb5_ccname
EOF
fi

insinto /etc
doins "${T}"/ldap.conf.sudo
fperms 0440 /etc/ldap.conf.sudo

insinto /etc/openldap/schema
newins docs/schema.OpenLDAP sudo.schema
fi

if use pam ; then
pamd_mimic system-auth sudo auth account session
pamd_mimic system-auth sudo-i auth account session
fi

keepdir /var/db/sudo/lectured
fperms 0700 /var/db/sudo/lectured
# bug #652958
fperms 0711 /var/db/sudo

# Don't install into /run as that is a tmpfs most of the time
# (bug #504854)
rm -rf "${ED}"/run || die

# bug #697812
find "${ED}" -type f -name "*.la" -delete || die
}

pkg_postinst() {
tmpfiles_process sudo.conf

# bug #652958
local sudo_db="${EROOT}/var/db/sudo"
if [[ "$(stat -c %a "${sudo_db}")" -ne 711 ]] ; then
chmod 711 "${sudo_db}" || die
fi

if use ldap ; then
ewarn
ewarn "sudo uses the ${ROOT}/etc/ldap.conf.sudo file for ldap configuration."
ewarn
if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
ewarn "configured in ${ROOT}/etc/nsswitch.conf."
ewarn
ewarn "To make use of LDAP, add this line to your ${ROOT}/etc/nsswitch.conf:"
ewarn " sudoers: ldap files"
ewarn
fi
fi
if use prefix ; then
ewarn
ewarn "To use sudo on Prefix, you need to change file ownership and permissions"
ewarn "with root privileges, as follows:"
ewarn
ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
ewarn " # chown root:root ${EPREFIX}/etc/sudoers.d"
ewarn " # chown root:root ${EPREFIX}/var/db/sudo"
ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
ewarn
fi

elog "To use the -A (askpass) option, you need to install a compatible"
elog "password program from the following list. Starred packages will"
elog "automatically register for the use with sudo (but will not force"
elog "the -A option):"
elog ""
elog " [*] net-misc/ssh-askpass-fullscreen"
elog " net-misc/x11-ssh-askpass"
elog ""
elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
elog "variable to the program you want to use."
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
DIST gzip-1.14.tar.xz 885748 BLAKE2B 32f7241bd9f3b7f73a59905a5bc9abf4e360e787f692cbb00ad28d48abee52744846d10c07ce2f7aaa3e66bc4b6ab9cd4f1b8e98854bb7d1ec010ae0d5146932 SHA512 82aef53188b3e69b51b7ddab5b8c44a11a5b73c0039b22a315a0c7d244694feab0146748add4265901eb1b4c0cee8a9eb69594995f098830d964091af97079c5
DIST gzip-1.14.tar.xz.sig 833 BLAKE2B a13ade68035fe32d69c24a1b5791ae6d7163cbbbebda396b4c773f2dc82ea6c619a44c39adc53dcd8fff094962a1c2dddfabfc7ec2cf54561202ef9a2be325ae SHA512 a5abd09e3b7bda8d87e5af7d2bd943e6021272cb0b6aa05625ddfeae45838aede1ffd91d7e0cb4e170f7f3078035f735f8441bc15cc115c51d302e0a11be44cf
DIST gzip-1.14_p20260502.tar.xz 829092 BLAKE2B fc98853530b4c0e52f1276cf07969acaa42434773d62375d4048fe17b5984ae316ffb8d0ffa949bb5e772adbcab477a79890fc79f1ac4387dd9b2d5e29c337be SHA512 5507ea6ac68ed7c0f4eaf17e6016800a6df597aa9015f91b5c1ca1422f9edd0a8b714c29e7678bfa57a2f45f220ae2ca4e94f1d3dff2b2a7a2cd602e93b364ef
DIST gzip-1.14_p20260502.tar.xz.sig 833 BLAKE2B 13c0c9f39f8ff3e210a772c0ce83bfb2f9f2fabf73ea505dd4f16b80be8b8c3c1eb8f8916ee71c1ac1d562c71a5ca6d6fa522b4624b16e7a6eb67c654f66cd70 SHA512 48816f0d47e44e13b841937f70a4479a5a912ad1bf150640c8e157010853381806af2a1ba8959eced17c630abf9ae6e22f041bb4bed856a6b93f213b3210378a
DIST gzip-1.14_p20260901.tar.xz 834840 BLAKE2B e78aff73b626d3a68ac84ebe590a6a2d67c106aaf7a7ffe1195131322f9ce3fe5fc35a12de4950b29bda4aaf684f8e829425e79186b525544b2c7e0abac45bec SHA512 b2ff6352f819c14de98e87ab5ce54d21b6201d3a00c90163ca769cd72de6a636a8d50b7576e63a963f219820605a43e3744dbfca251f6755f8d62de75575b55a
DIST gzip-1.14_p20260901.tar.xz.sig 833 BLAKE2B 503c5ab9607658fa48ce857155563a0b264d2a398b84e2814cb537bb9d351471dd86743ec98b60f17f76b2365edd785363709e2883a540661d5f93b358a11857 SHA512 35c78a77f2f40e330f5950e028452e488f2758347e3c09b711c540a9bf1f4d289e617b07060b39c640f79827a321f5ed9f2c72d1791b6e4a98678ca1ed96e3a9
DIST gzip-1.15.tar.xz 808900 BLAKE2B efa81df3df766502c5ffde551570b568c73d3b2ad0b2c76bd79b0ed5cea4deb5e0a3d803b942a078efdc4df9cde355863aadc51752498a9e7dec8737be559850 SHA512 4a2ff92df8a49e1bbcbf65c3a70434660ad02f084d1b453f7dcaa8ee84f248cc4bb06f62bd8e57fea1e05ba1275c7c584ce97a58856e4ca6105f6417c8efbc3c
DIST gzip-1.15.tar.xz.sig 833 BLAKE2B 76876e384194c5d4ea4f57932395d8ceecfea0a8c1b221b85fd4b2087d2acc9298a88ea0d9f257f61eb05dd691caf6cb5f20520a678f3d457140413f328424a1 SHA512 11876f760d3867fabe4e104b0adb4f08c9867b2470f6428dedd8a4f5eb68160e4f8410a46d397e7596afc99b562eab4381f197ede5305c9cca401d122c2583c2
Loading