Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
316 commits
Select commit Hold shift + click to select a range
00de200
dev-lang/tcl: Sync with Gentoo
Jun 8, 2026
d372865
dev-libs/cJSON: Sync with Gentoo
Jun 8, 2026
f92d29c
dev-libs/elfutils: Sync with Gentoo
Jun 8, 2026
72fbe7f
dev-libs/expat: Sync with Gentoo
Jun 8, 2026
39a83c5
dev-libs/glib: Sync with Gentoo
Jun 8, 2026
02ba3b6
dev-libs/gmp: Sync with Gentoo
Jun 8, 2026
815ad28
dev-libs/jose: Sync with Gentoo
Jun 8, 2026
45a0734
dev-libs/json-c: Sync with Gentoo
Jun 8, 2026
8aec31d
dev-libs/libaio: Sync with Gentoo
Jun 8, 2026
1bf2b5a
dev-libs/libdnet: Sync with Gentoo
Jun 8, 2026
96de5d4
dev-libs/libgcrypt: Sync with Gentoo
Jun 8, 2026
8bac89a
dev-libs/libgpg-error: Sync with Gentoo
Jun 8, 2026
a1012f7
dev-libs/libksba: Sync with Gentoo
Jun 8, 2026
b3bfbdd
dev-libs/libltdl: Sync with Gentoo
Jun 8, 2026
bc041ac
dev-libs/libpcre2: Sync with Gentoo
Jun 8, 2026
31d8684
dev-libs/libpwquality: Sync with Gentoo
Jun 8, 2026
fb328a6
dev-libs/libsodium: Sync with Gentoo
Jun 8, 2026
8b760b1
dev-libs/libtasn1: Sync with Gentoo
Jun 8, 2026
6625328
dev-libs/libtraceevent: Sync with Gentoo
Jun 8, 2026
18e9383
dev-libs/libtracefs: Sync with Gentoo
Jun 8, 2026
3e310e4
dev-libs/libunistring: Sync with Gentoo
Jun 8, 2026
d81b984
dev-libs/libusb: Sync with Gentoo
Jun 8, 2026
c93f0fc
dev-libs/libuv: Sync with Gentoo
Jun 8, 2026
a02afa6
dev-libs/libverto: Sync with Gentoo
Jun 8, 2026
e5bb7ca
dev-libs/libxml2: Sync with Gentoo
Jun 8, 2026
c9a3a7c
dev-libs/lzo: Sync with Gentoo
Jun 8, 2026
606fab6
dev-libs/mpc: Sync with Gentoo
Jun 8, 2026
77994a6
dev-libs/mpdecimal: Sync with Gentoo
Jun 8, 2026
6efe253
dev-libs/npth: Sync with Gentoo
Jun 8, 2026
4821cb2
dev-libs/nspr: Sync with Gentoo
Jun 8, 2026
87e9770
dev-libs/opensc: Sync with Gentoo
Jun 8, 2026
1ac695a
dev-libs/openssl: Sync with Gentoo
Jun 8, 2026
7300008
dev-libs/protobuf: Sync with Gentoo
Jun 8, 2026
0de205e
dev-libs/rapidjson: Sync with Gentoo
Jun 8, 2026
3fc6fdc
dev-libs/tree-sitter: Sync with Gentoo
Jun 8, 2026
226cdaa
dev-libs/xmlsec: Sync with Gentoo
Jun 8, 2026
3d1e7ff
dev-python/cachecontrol: Sync with Gentoo
Jun 8, 2026
28589f4
dev-python/certifi: Sync with Gentoo
Jun 8, 2026
31073ec
dev-python/cffi: Sync with Gentoo
Jun 8, 2026
2dd852f
dev-python/chardet: Sync with Gentoo
Jun 8, 2026
3f0398d
dev-python/charset-normalizer: Sync with Gentoo
Jun 8, 2026
c9ff964
dev-python/cryptography: Sync with Gentoo
Jun 8, 2026
b713d00
dev-python/cython: Sync with Gentoo
Jun 8, 2026
002991b
dev-python/dependency-groups: Sync with Gentoo
Jun 8, 2026
d0b6824
dev-python/distlib: Sync with Gentoo
Jun 8, 2026
00e5a49
dev-python/docutils: Sync with Gentoo
Jun 8, 2026
9a7fe98
dev-python/editables: Sync with Gentoo
Jun 8, 2026
8b406dc
dev-python/ensurepip-pip: Sync with Gentoo
Jun 8, 2026
77accf5
dev-python/ensurepip-setuptools: Sync with Gentoo
Jun 8, 2026
a39db72
dev-python/fastjsonschema: Sync with Gentoo
Jun 8, 2026
496cd3c
dev-python/flit-core: Sync with Gentoo
Jun 8, 2026
f19ef81
dev-python/gpep517: Sync with Gentoo
Jun 8, 2026
776ebb9
dev-python/hatch-vcs: Sync with Gentoo
Jun 8, 2026
56be839
dev-python/hatchling: Sync with Gentoo
Jun 8, 2026
5c89868
dev-python/idna: Sync with Gentoo
Jun 8, 2026
d2839e9
dev-python/installer: Sync with Gentoo
Jun 8, 2026
06bd594
dev-python/jaraco-collections: Sync with Gentoo
Jun 8, 2026
c68a930
dev-python/jaraco-context: Sync with Gentoo
Jun 8, 2026
5cf0280
dev-python/jaraco-functools: Sync with Gentoo
Jun 8, 2026
48546e2
dev-python/jaraco-text: Sync with Gentoo
Jun 8, 2026
bf60a0d
dev-python/jinja2: Sync with Gentoo
Jun 8, 2026
78d0150
dev-python/lark: Sync with Gentoo
Jun 8, 2026
3b475cd
dev-python/lazy-object-proxy: Sync with Gentoo
Jun 8, 2026
5edb5db
dev-python/linkify-it-py: Sync with Gentoo
Jun 8, 2026
99bc979
dev-python/lxml: Sync with Gentoo
Jun 8, 2026
fadd7b6
dev-python/markdown-it-py: Sync with Gentoo
Jun 8, 2026
df4ad68
dev-python/markupsafe: Sync with Gentoo
Jun 8, 2026
a6d26d6
dev-python/more-itertools: Sync with Gentoo
Jun 8, 2026
9d22784
dev-python/msgpack: Sync with Gentoo
Jun 8, 2026
d1c8a35
dev-python/packaging: Sync with Gentoo
Jun 8, 2026
3e3c7e0
dev-python/pathspec: Sync with Gentoo
Jun 8, 2026
8880116
dev-python/pip: Sync with Gentoo
Jun 8, 2026
853478d
dev-python/platformdirs: Sync with Gentoo
Jun 8, 2026
534364c
dev-python/pluggy: Sync with Gentoo
Jun 8, 2026
e07d196
dev-python/ply: Sync with Gentoo
Jun 8, 2026
2a325db
dev-python/poetry-core: Sync with Gentoo
Jun 8, 2026
c40430e
dev-python/pycparser: Sync with Gentoo
Jun 8, 2026
bf48f57
dev-python/pydecomp: Sync with Gentoo
Jun 8, 2026
3357bf8
dev-python/pygments: Sync with Gentoo
Jun 8, 2026
bd857f3
dev-python/pyproject-hooks: Sync with Gentoo
Jun 8, 2026
4f92ae0
dev-python/pysocks: Sync with Gentoo
Jun 8, 2026
8f57938
dev-python/requests: Sync with Gentoo
Jun 8, 2026
e3bcdf4
dev-python/resolvelib: Sync with Gentoo
Jun 8, 2026
92150d9
dev-python/rich: Sync with Gentoo
Jun 8, 2026
e0aa9c6
dev-python/setuptools: Sync with Gentoo
Jun 8, 2026
360f887
dev-python/setuptools-scm: Sync with Gentoo
Jun 8, 2026
cfda27e
dev-python/six: Sync with Gentoo
Jun 8, 2026
021d38e
dev-python/snakeoil: Sync with Gentoo
Jun 8, 2026
74e9794
dev-python/tomli: Sync with Gentoo
Jun 8, 2026
39e87fe
dev-python/tomli-w: Sync with Gentoo
Jun 8, 2026
e174813
dev-python/tree-sitter: Sync with Gentoo
Jun 8, 2026
9c8c4e1
dev-python/trove-classifiers: Sync with Gentoo
Jun 8, 2026
6ea635e
dev-python/truststore: Sync with Gentoo
Jun 8, 2026
07ceaf6
dev-python/typing-extensions: Sync with Gentoo
Jun 8, 2026
5991c7c
dev-python/uc-micro-py: Sync with Gentoo
Jun 8, 2026
7829552
dev-python/urllib3: Sync with Gentoo
Jun 8, 2026
758c24c
dev-python/wheel: Sync with Gentoo
Jun 8, 2026
4e24acf
dev-util/bpftool: Sync with Gentoo
Jun 8, 2026
7226f74
dev-util/catalyst: Sync with Gentoo
Jun 8, 2026
a7693d6
dev-util/debugedit: Sync with Gentoo
Jun 8, 2026
f26b31d
dev-util/gdbus-codegen: Sync with Gentoo
Jun 8, 2026
22feeec
dev-util/glib-utils: Sync with Gentoo
Jun 8, 2026
00eb35f
dev-util/maturin: Sync with Gentoo
Jun 8, 2026
992fcf8
dev-util/pahole: Sync with Gentoo
Jun 8, 2026
f581b6b
dev-util/patchutils: Sync with Gentoo
Jun 8, 2026
a050dee
dev-util/perf: Sync with Gentoo
Jun 8, 2026
9e12407
dev-vcs/git: Sync with Gentoo
Jun 8, 2026
881390d
eclass/cargo: Sync with Gentoo
Jun 8, 2026
cc815ee
eclass/dist-kernel-utils: Sync with Gentoo
Jun 8, 2026
e916f94
eclass/distutils-r1: Sync with Gentoo
Jun 8, 2026
3a27e86
eclass/git-r3: Sync with Gentoo
Jun 8, 2026
cf49b88
eclass/go-env: Sync with Gentoo
Jun 8, 2026
ab8455a
eclass/go-module: Sync with Gentoo
Jun 8, 2026
2dabdff
eclass/kernel-2: Sync with Gentoo
Jun 8, 2026
15273aa
eclass/linux-mod: Sync with Gentoo
Jun 8, 2026
6129f97
eclass/llvm-r1: Sync with Gentoo
Jun 8, 2026
73ee00e
eclass/llvm: Sync with Gentoo
Jun 8, 2026
5b4edbf
eclass/meson: Sync with Gentoo
Jun 8, 2026
d1914a8
eclass/multilib: Sync with Gentoo
Jun 8, 2026
abfed14
eclass/multiprocessing: Sync with Gentoo
Jun 8, 2026
bbc5eac
eclass/python-utils-r1: Sync with Gentoo
Jun 8, 2026
278fdf8
eclass/rpm: Sync with Gentoo
Jun 8, 2026
df9b39c
eclass/ruby-utils: Sync with Gentoo
Jun 8, 2026
3ab07b8
eclass/rust: Sync with Gentoo
Jun 8, 2026
6fba451
eclass/selinux-policy-2: Sync with Gentoo
Jun 8, 2026
3b67646
eclass/sysroot: Sync with Gentoo
Jun 8, 2026
07ef06c
eclass/toolchain-funcs: Sync with Gentoo
Jun 8, 2026
bcde9f6
eclass/toolchain: Sync with Gentoo
Jun 8, 2026
77d9d5e
eclass/udev: Sync with Gentoo
Jun 8, 2026
8876a24
licenses: Sync with Gentoo
Jun 8, 2026
9dd96cc
media-libs/libpng: Sync with Gentoo
Jun 8, 2026
b794ff6
net-analyzer/netperf: Sync with Gentoo
Jun 8, 2026
82f653b
net-analyzer/openbsd-netcat: Sync with Gentoo
Jun 8, 2026
e3ccd59
net-dialup/lrzsz: Sync with Gentoo
Jun 8, 2026
c82929d
net-dialup/minicom: Sync with Gentoo
Jun 8, 2026
968c3dc
net-dns/bind: Sync with Gentoo
Jun 8, 2026
cfee003
net-dns/dnsmasq: Sync with Gentoo
Jun 8, 2026
2ab730b
net-dns/libidn2: Sync with Gentoo
Jun 8, 2026
eab78c1
net-firewall/conntrack-tools: Sync with Gentoo
Jun 8, 2026
0381c95
net-firewall/ipset: Sync with Gentoo
Jun 8, 2026
5119688
net-firewall/iptables: Sync with Gentoo
Jun 8, 2026
ddc8d63
net-fs/cifs-utils: Sync with Gentoo
Jun 8, 2026
9eb3ee9
net-fs/samba: Sync with Gentoo
Jun 8, 2026
db2cd6d
net-libs/gnutls: Sync with Gentoo
Jun 8, 2026
3d907d9
net-libs/libmicrohttpd: Sync with Gentoo
Jun 8, 2026
8218af8
net-libs/libnetfilter_conntrack: Sync with Gentoo
Jun 8, 2026
0ff3cae
net-libs/libnetfilter_queue: Sync with Gentoo
Jun 8, 2026
38c4d9e
net-libs/libslirp: Sync with Gentoo
Jun 8, 2026
95e8605
net-libs/libtirpc: Sync with Gentoo
Jun 8, 2026
610f3da
net-libs/nghttp2: Sync with Gentoo
Jun 8, 2026
aeb5191
net-libs/ngtcp2: Sync with Gentoo
Jun 8, 2026
40e1efc
net-misc/chrony: Sync with Gentoo
Jun 8, 2026
b847d43
net-misc/curl: Sync with Gentoo
Jun 8, 2026
a63685b
net-misc/iperf: Sync with Gentoo
Jun 8, 2026
9eb72de
net-misc/iputils: Sync with Gentoo
Jun 8, 2026
d2fb0f5
net-misc/ntp: Sync with Gentoo
Jun 8, 2026
e64bd34
net-misc/openssh: Sync with Gentoo
Jun 8, 2026
5d60de4
net-misc/rsync: Sync with Gentoo
Jun 8, 2026
cd6b062
net-misc/socat: Sync with Gentoo
Jun 8, 2026
77e2f05
net-misc/wget: Sync with Gentoo
Jun 8, 2026
19a40c0
net-misc/whois: Sync with Gentoo
Jun 8, 2026
2f834e7
profiles: Sync with Gentoo
Jun 8, 2026
bda7b87
sec-keys/openpgp-keys-gentoo-release: Sync with Gentoo
Jun 8, 2026
56567c6
sec-policy/selinux-base: Sync with Gentoo
Jun 8, 2026
8d26222
sec-policy/selinux-base-policy: Sync with Gentoo
Jun 8, 2026
935ea31
sec-policy/selinux-container: Sync with Gentoo
Jun 8, 2026
d3624b5
sec-policy/selinux-dbus: Sync with Gentoo
Jun 8, 2026
4e77112
sec-policy/selinux-policykit: Sync with Gentoo
Jun 8, 2026
1d1ba32
sec-policy/selinux-sssd: Sync with Gentoo
Jun 8, 2026
967065f
sec-policy/selinux-unconfined: Sync with Gentoo
Jun 8, 2026
cfe3321
sys-apps/bubblewrap: Sync with Gentoo
Jun 8, 2026
b0825c3
sys-apps/busybox: Sync with Gentoo
Jun 8, 2026
a185396
sys-apps/checkpolicy: Sync with Gentoo
Jun 8, 2026
aa936a8
sys-apps/coreutils: Sync with Gentoo
Jun 8, 2026
3277d4f
sys-apps/dbus: Sync with Gentoo
Jun 8, 2026
26ce0e4
sys-apps/debianutils: Sync with Gentoo
Jun 8, 2026
8694de1
sys-apps/dtc: Sync with Gentoo
Jun 8, 2026
168f57e
sys-apps/ethtool: Sync with Gentoo
Jun 8, 2026
8673e8d
sys-apps/file: Sync with Gentoo
Jun 8, 2026
b8cb371
sys-apps/findutils: Sync with Gentoo
Jun 8, 2026
1a67b4c
sys-apps/gawk: Sync with Gentoo
Jun 8, 2026
caa2f49
sys-apps/gentoo-functions: Sync with Gentoo
Jun 8, 2026
d8d76af
sys-apps/groff: Sync with Gentoo
Jun 8, 2026
f6fca41
sys-apps/hwdata: Sync with Gentoo
Jun 8, 2026
503be34
sys-apps/i2c-tools: Sync with Gentoo
Jun 8, 2026
b327276
sys-apps/iproute2: Sync with Gentoo
Jun 8, 2026
ba2f73c
sys-apps/kbd: Sync with Gentoo
Jun 8, 2026
b227d78
sys-apps/less: Sync with Gentoo
Jun 8, 2026
01dd966
sys-apps/man-db: Sync with Gentoo
Jun 8, 2026
b9ef5ea
sys-apps/man-pages: Sync with Gentoo
Jun 8, 2026
10716b4
sys-apps/pciutils: Sync with Gentoo
Jun 8, 2026
bb04644
sys-apps/pcsc-lite: Sync with Gentoo
Jun 8, 2026
0e56b17
sys-apps/portage: Sync with Gentoo
Jun 8, 2026
03fba4d
sys-apps/pv: Sync with Gentoo
Jun 8, 2026
fac81bf
sys-apps/sandbox: Sync with Gentoo
Jun 8, 2026
6cca0f9
sys-apps/sed: Sync with Gentoo
Jun 8, 2026
c5b9c6c
sys-apps/semodule-utils: Sync with Gentoo
Jun 8, 2026
a76f1fe
sys-apps/shadow: Sync with Gentoo
Jun 8, 2026
d19cb13
sys-apps/systemd: Sync with Gentoo
Jun 8, 2026
0b016f0
sys-apps/texinfo: Sync with Gentoo
Jun 8, 2026
2afbdd8
sys-apps/usbutils: Sync with Gentoo
Jun 8, 2026
ccded0e
sys-apps/util-linux: Sync with Gentoo
Jun 8, 2026
410469c
sys-auth/pambase: Sync with Gentoo
Jun 8, 2026
80b7364
sys-auth/polkit: Sync with Gentoo
Jun 8, 2026
bab562d
sys-auth/sssd: Sync with Gentoo
Jun 8, 2026
9c61141
sys-block/open-iscsi: Sync with Gentoo
Jun 8, 2026
b2d5bc4
sys-block/open-isns: Sync with Gentoo
Jun 8, 2026
5532e72
sys-block/parted: Sync with Gentoo
Jun 8, 2026
485dd50
sys-block/thin-provisioning-tools: Sync with Gentoo
Jun 8, 2026
271dade
sys-boot/grub: Sync with Gentoo
Jun 8, 2026
ebb5c3e
sys-devel/binutils-config: Sync with Gentoo
Jun 8, 2026
179262f
sys-devel/crossdev: Sync with Gentoo
Jun 8, 2026
088e4a5
sys-devel/gcc: Sync with Gentoo
Jun 8, 2026
489e591
sys-devel/gcc-config: Sync with Gentoo
Jun 8, 2026
2ccea90
sys-devel/gettext: Sync with Gentoo
Jun 8, 2026
70fd031
sys-devel/patch: Sync with Gentoo
Jun 8, 2026
677c6b6
sys-firmware/edk2-bin: Sync with Gentoo
Jun 8, 2026
a01ba16
sys-firmware/intel-microcode: Sync with Gentoo
Jun 8, 2026
381726c
sys-fs/btrfs-progs: Sync with Gentoo
Jun 8, 2026
53327b9
sys-fs/cryptsetup: Sync with Gentoo
Jun 8, 2026
579e3b3
sys-fs/e2fsprogs: Sync with Gentoo
Jun 8, 2026
2249031
sys-fs/fuse: Sync with Gentoo
Jun 8, 2026
19b6f66
sys-fs/lvm2: Sync with Gentoo
Jun 8, 2026
78296a6
sys-fs/lxcfs: Sync with Gentoo
Jun 8, 2026
9ddbffc
sys-fs/mdadm: Sync with Gentoo
Jun 8, 2026
bd570ad
sys-fs/mtools: Sync with Gentoo
Jun 8, 2026
6c3cb29
sys-fs/multipath-tools: Sync with Gentoo
Jun 8, 2026
f15bef3
sys-fs/squashfs-tools: Sync with Gentoo
Jun 8, 2026
443ff5e
sys-fs/xfsprogs: Sync with Gentoo
Jun 8, 2026
eec2c1e
sys-fs/zfs: Sync with Gentoo
Jun 8, 2026
03efd91
sys-fs/zfs-kmod: Sync with Gentoo
Jun 8, 2026
ba0ccd7
sys-kernel/dracut: Sync with Gentoo
Jun 8, 2026
33308d4
sys-libs/cracklib: Sync with Gentoo
Jun 8, 2026
e0b77ea
sys-libs/glibc: Sync with Gentoo
Jun 8, 2026
ecc33fa
sys-libs/libcap: Sync with Gentoo
Jun 8, 2026
8d29cb8
sys-libs/libcap-ng: Sync with Gentoo
Jun 8, 2026
54d0209
sys-libs/libseccomp: Sync with Gentoo
Jun 8, 2026
705b5be
sys-libs/libselinux: Sync with Gentoo
Jun 8, 2026
2d1c257
sys-libs/libsepol: Sync with Gentoo
Jun 8, 2026
e7bd497
sys-libs/libunwind: Sync with Gentoo
Jun 8, 2026
e7a7866
sys-libs/libxcrypt: Sync with Gentoo
Jun 8, 2026
3c19da1
sys-libs/ncurses: Sync with Gentoo
Jun 8, 2026
40e8e01
sys-libs/talloc: Sync with Gentoo
Jun 8, 2026
c448e2c
sys-libs/tdb: Sync with Gentoo
Jun 8, 2026
a97053a
sys-libs/timezone-data: Sync with Gentoo
Jun 8, 2026
9dccb1c
sys-libs/zlib: Sync with Gentoo
Jun 8, 2026
9ab8fd4
sys-process/audit: Sync with Gentoo
Jun 8, 2026
b47fddd
sys-process/lsof: Sync with Gentoo
Jun 8, 2026
ed31d82
sys-process/procps: Sync with Gentoo
Jun 8, 2026
7f20ddb
x11-drivers/nvidia-drivers: Sync with Gentoo
Jun 8, 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
@@ -0,0 +1,28 @@
https://bugs.gentoo.org/934983
https://github.com/logrotate/logrotate/commit/04b21743980c4e236ca5e8de18173fbd3848573b

From 04b21743980c4e236ca5e8de18173fbd3848573b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Sat, 8 Jun 2024 17:59:40 +0200
Subject: [PATCH] test: avoid locale dependent errno string

String representations of errno values are locale dependent, thus avoid
using them.
---
test/test-0112.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test-0112.sh b/test/test-0112.sh
index 812632b1..fa9eed65 100755
--- a/test/test-0112.sh
+++ b/test/test-0112.sh
@@ -23,7 +23,7 @@ test_reg.log.1.gz 1 zero
test_reg.log.2.gz 1 first
EOF

-grep "test_fifo.log.1 (read-only) for compression: Operation not supported" error.log >/dev/null
+grep "^error: unable to open .*/test_fifo\.log\.1 (read-only) for compression: " error.log >/dev/null
if [ $? != 0 ]; then
echo "No error printed, but there should be one."
exit 3

Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
https://github.com/logrotate/logrotate/issues/632
https://github.com/logrotate/logrotate/pull/633

From d2e090a9c0ba62aeab8c415aecf3067297f3eccc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Sat, 3 Aug 2024 19:07:38 +0200
Subject: [PATCH] Avoid opening log file for getting SELinux context

Currently setSecCtxByName() uses open_logfile() to get a file descriptor
to the current log file to retrieve its security context.
open_logfile() performs additional checks, like whether the file is a
regular file, which alter the control flow between systems with SELinux
enabled and disabled. This can be observed in the reported issue #632.
Use lgetfilecon_raw() instead to have the same behavior for SELinux
enabled and disabled systems and delay the checks for invalid log files
to code executed in both cases.

Closes: #632
---
logrotate.c | 89 ++++++++++++++++++++++++++++++-----------------------
1 file changed, 51 insertions(+), 38 deletions(-)

diff --git a/logrotate.c b/logrotate.c
index ba779950..c62e7c78 100644
--- a/logrotate.c
+++ b/logrotate.c
@@ -361,27 +361,9 @@ static int movefd(int oldfd, int newfd)
return rc;
}

-static int setSecCtx(int fdSrc, const char *src, char **pPrevCtx)
-{
#ifdef WITH_SELINUX
- char *srcCtx;
- *pPrevCtx = NULL;
-
- if (!selinux_enabled)
- /* pretend success */
- return 0;
-
- /* read security context of fdSrc */
- if (fgetfilecon_raw(fdSrc, &srcCtx) < 0) {
- if (errno == ENOTSUP)
- /* pretend success */
- return 0;
-
- message(MESS_ERROR, "getting file context %s: %s\n", src,
- strerror(errno));
- return selinux_enforce;
- }
-
+static int setSecCtx(char *srcCtx, char **pPrevCtx)
+{
/* save default security context for restoreSecCtx() */
if (getfscreatecon_raw(pPrevCtx) < 0) {
message(MESS_ERROR, "getting default context: %s\n", strerror(errno));
@@ -401,37 +383,68 @@ static int setSecCtx(int fdSrc, const char *src, char **pPrevCtx)

message(MESS_DEBUG, "set default create context to %s\n", srcCtx);
freecon(srcCtx);
+
+ return 0;
+}
+#endif /* WITH_SELINUX */
+
+static int setSecCtxByFd(int fdSrc, const char *src, char **pPrevCtx)
+{
+#ifdef WITH_SELINUX
+ char *srcCtx;
+ *pPrevCtx = NULL;
+
+ if (!selinux_enabled)
+ /* pretend success */
+ return 0;
+
+ /* read security context of fdSrc */
+ if (fgetfilecon_raw(fdSrc, &srcCtx) < 0) {
+ if (errno == ENOTSUP)
+ /* pretend success */
+ return 0;
+
+ message(MESS_ERROR, "getting file context %s: %s\n", src,
+ strerror(errno));
+ return selinux_enforce;
+ }
+
+ return setSecCtx(srcCtx, pPrevCtx);
#else
(void) fdSrc;
(void) src;
(void) pPrevCtx;
-#endif
return 0;
+#endif /* WITH_SELINUX */
}

-static int setSecCtxByName(const char *src, const struct logInfo *log, char **pPrevCtx)
+static int setSecCtxByName(const char *src, char **pPrevCtx)
{
- int hasErrors = 0;
#ifdef WITH_SELINUX
- int fd;
+ char *srcCtx;
+ *pPrevCtx = NULL;

if (!selinux_enabled)
/* pretend success */
return 0;

- fd = open_logfile(src, log, 0);
- if (fd < 0) {
- message(MESS_ERROR, "error opening %s: %s\n", src, strerror(errno));
- return 1;
+ /* read security context of src */
+ if (lgetfilecon_raw(src, &srcCtx) < 0) {
+ if (errno == ENOTSUP)
+ /* pretend success */
+ return 0;
+
+ message(MESS_ERROR, "getting file context %s: %s\n", src,
+ strerror(errno));
+ return selinux_enforce;
}
- hasErrors = setSecCtx(fd, src, pPrevCtx);
- close(fd);
+
+ return setSecCtx(srcCtx, pPrevCtx);
#else
(void) src;
- (void) log;
(void) pPrevCtx;
-#endif
- return hasErrors;
+ return 0;
+#endif /* WITH_SELINUX */
}

static void restoreSecCtx(char **pPrevCtx)
@@ -874,7 +887,7 @@ static int compressLogFile(const char *name, const struct logInfo *log, const st
return 1;
}

- if (setSecCtx(inFile, name, &prevCtx) != 0) {
+ if (setSecCtxByFd(inFile, name, &prevCtx) != 0) {
/* error msg already printed */
close(inFile);
return 1;
@@ -1307,7 +1320,7 @@ static int copyTruncate(const char *currLog, const char *saveLog, const struct s
if (!skip_copy) {
char *prevCtx;

- if (setSecCtx(fdcurr, currLog, &prevCtx) != 0) {
+ if (setSecCtxByFd(fdcurr, currLog, &prevCtx) != 0) {
/* error msg already printed */
goto fail;
}
@@ -1905,7 +1918,7 @@ static int prerotateSingleLog(const struct logInfo *log, unsigned logNum,
message(MESS_DEBUG, "dateext suffix '%s'\n", dext_str);
message(MESS_DEBUG, "glob pattern '%s'\n", dext_pattern);

- if (setSecCtxByName(log->files[logNum], log, &prev_context) != 0) {
+ if (setSecCtxByName(log->files[logNum], &prev_context) != 0) {
/* error msg already printed */
return 1;
}
@@ -2186,7 +2199,7 @@ static int rotateSingleLog(const struct logInfo *log, unsigned logNum,
if (!hasErrors) {

if (!(log->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY))) {
- if (setSecCtxByName(log->files[logNum], log, &savedContext) != 0) {
+ if (setSecCtxByName(log->files[logNum], &savedContext) != 0) {
/* error msg already printed */
return 1;
}
@@ -2730,7 +2743,7 @@ static int writeState(const char *stateFilename)

/* get attributes, to assign them to the new state file */

- if (setSecCtx(fdcurr, stateFilename, &prevCtx) != 0) {
+ if (setSecCtxByFd(fdcurr, stateFilename, &prevCtx) != 0) {
/* error msg already printed */
free(tmpFilename);
close(fdcurr);

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

EAPI=8

inherit systemd tmpfiles

DESCRIPTION="Rotates, compresses, and mails system logs"
HOMEPAGE="https://github.com/logrotate/logrotate"

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

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"

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

LICENSE="GPL-2"
SLOT="0"
IUSE="acl +cron selinux"

DEPEND="
>=dev-libs/popt-1.5
acl? ( virtual/acl )
selinux? ( sys-libs/libselinux )
"
RDEPEND="
${DEPEND}
cron? ( virtual/cron )
selinux? ( sec-policy/selinux-logrotate )
"

STATEFILE="${EPREFIX}/var/lib/misc/logrotate.status"
OLDSTATEFILE="${EPREFIX}/var/lib/logrotate.status"

PATCHES=(
"${FILESDIR}"/${PN}-3.15.0-ignore-hidden.patch
"${FILESDIR}"/${P}-tests-locale.patch
"${FILESDIR}"/${P}-tests-selinux.patch
)

move_old_state_file() {
elog "logrotate state file is now located at ${STATEFILE}"
elog "See bug #357275"
if [[ -e "${OLDSTATEFILE}" ]] ; then
elog "Moving your current state file to new location: ${STATEFILE}"
mv -n "${OLDSTATEFILE}" "${STATEFILE}" || die
fi
}

install_cron_file() {
exeinto /etc/cron.daily
newexe "${S}"/examples/logrotate.cron "${PN}"
}

src_prepare() {
default

sed -i -e 's#/usr/sbin/logrotate#/usr/bin/logrotate#' examples/logrotate.{cron,service} || die

[[ ${PV} == 9999 ]] && eautoreconf
}

src_configure() {
econf \
$(use_with acl) \
$(use_with selinux) \
--with-state-file-path="${STATEFILE}"
}

src_install() {
dobin logrotate
doman logrotate.8
dodoc ChangeLog.md

insinto /etc
doins "${FILESDIR}"/logrotate.conf

use cron && install_cron_file

systemd_dounit examples/logrotate.{service,timer}
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}.conf

keepdir /etc/logrotate.d
}

pkg_postinst() {
elog
elog "The ${PN} binary is now installed under /usr/bin. Please"
elog "update your links"
elog

move_old_state_file

tmpfiles_process ${PN}.conf

if [[ -z ${REPLACING_VERSIONS} ]] ; then
elog "If you wish to have logrotate e-mail you updates, please"
elog "emerge virtual/mailx and configure logrotate in"
elog "/etc/logrotate.conf appropriately"
elog
elog "Additionally, /etc/logrotate.conf may need to be modified"
elog "for your particular needs. See man logrotate for details."
fi
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/cgzones.asc
inherit systemd tmpfiles verify-sig
inherit systemd tmpfiles

DESCRIPTION="Rotates, compresses, and mails system logs"
HOMEPAGE="https://github.com/logrotate/logrotate"
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 )"

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

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"

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

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
IUSE="acl +cron selinux"

DEPEND="
Expand All @@ -26,7 +37,6 @@ RDEPEND="
cron? ( virtual/cron )
selinux? ( sec-policy/selinux-logrotate )
"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-cgzones )"

STATEFILE="${EPREFIX}/var/lib/misc/logrotate.status"
OLDSTATEFILE="${EPREFIX}/var/lib/logrotate.status"
Expand All @@ -53,6 +63,8 @@ src_prepare() {
default

sed -i -e 's#/usr/sbin/logrotate#/usr/bin/logrotate#' examples/logrotate.{cron,service} || die

[[ ${PV} == 9999 ]] && eautoreconf
}

src_configure() {
Expand Down
Loading