Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
8769c59
acct-user/nobody: Sync with Gentoo
Jun 29, 2026
b14baf6
app-admin/logrotate: Sync with Gentoo
Jun 29, 2026
fafb1d6
app-alternatives/ninja: Sync with Gentoo
Jun 29, 2026
100b783
app-arch/libarchive: Sync with Gentoo
Jun 29, 2026
5f44568
app-containers/aardvark-dns: Sync with Gentoo
Jun 29, 2026
677c742
app-containers/conmon: Sync with Gentoo
Jun 29, 2026
ef32634
app-containers/containerd: Sync with Gentoo
Jun 29, 2026
2dac28f
app-containers/cri-tools: Sync with Gentoo
Jun 29, 2026
b7d8836
app-containers/crun: Sync with Gentoo
Jun 29, 2026
757c9ae
app-containers/docker: Sync with Gentoo
Jun 29, 2026
3d4cfce
app-containers/docker-buildx: Sync with Gentoo
Jun 29, 2026
b405172
app-containers/docker-cli: Sync with Gentoo
Jun 29, 2026
d648a14
app-containers/incus: Sync with Gentoo
Jun 29, 2026
82b7642
app-containers/lxc: Sync with Gentoo
Jun 29, 2026
78f4e48
app-containers/netavark: Sync with Gentoo
Jun 29, 2026
917d60c
app-containers/podman: Sync with Gentoo
Jun 29, 2026
3205201
app-containers/runc: Sync with Gentoo
Jun 29, 2026
2d7221d
app-crypt/adcli: Sync with Gentoo
Jun 29, 2026
e52d4c2
app-crypt/gnupg: Sync with Gentoo
Jun 29, 2026
1d36e83
app-crypt/gpgme: Sync with Gentoo
Jun 29, 2026
4bdfa57
app-crypt/libmd: Sync with Gentoo
Jun 29, 2026
9405f1e
app-crypt/mit-krb5: Sync with Gentoo
Jun 29, 2026
06ef58d
app-crypt/pinentry: Sync with Gentoo
Jun 29, 2026
011b2a9
app-crypt/rhash: Sync with Gentoo
Jun 29, 2026
1686c79
app-crypt/tpm2-tss: Sync with Gentoo
Jun 29, 2026
c7765d1
app-doc/eclass-manpages: Sync with Gentoo
Jun 29, 2026
233b7ff
app-editors/nano: Sync with Gentoo
Jun 29, 2026
16b2639
app-emulation/qemu: Sync with Gentoo
Jun 29, 2026
d7b6db4
app-emulation/qemu-guest-agent: Sync with Gentoo
Jun 29, 2026
ac6b80d
app-emulation/virt-firmware: Sync with Gentoo
Jun 29, 2026
f079781
app-eselect/eselect-pinentry: Sync with Gentoo
Jun 29, 2026
cbdf2c0
app-misc/jq: Sync with Gentoo
Jun 29, 2026
501533a
app-misc/mime-types: Sync with Gentoo
Jun 29, 2026
367f024
app-portage/gentoolkit: Sync with Gentoo
Jun 29, 2026
0c2d320
app-portage/getuto: Sync with Gentoo
Jun 29, 2026
6ad4190
app-shells/bash: Sync with Gentoo
Jun 29, 2026
6f88169
dev-build/autoconf: Sync with Gentoo
Jun 29, 2026
682ceae
dev-build/automake: Sync with Gentoo
Jun 29, 2026
5d7e5a5
dev-build/cmake: Sync with Gentoo
Jun 29, 2026
d713fb9
dev-build/meson: Sync with Gentoo
Jun 29, 2026
74bf693
dev-db/etcd: Sync with Gentoo
Jun 29, 2026
77c5e30
dev-db/sqlite: Sync with Gentoo
Jun 29, 2026
3ccb0b5
dev-debug/gdb: Sync with Gentoo
Jun 29, 2026
7c7979e
dev-debug/strace: Sync with Gentoo
Jun 29, 2026
6a14bbf
dev-go/go-md2man: Sync with Gentoo
Jun 29, 2026
e5b11bc
dev-lang/go: Sync with Gentoo
Jun 29, 2026
1ecf970
dev-lang/perl: Sync with Gentoo
Jun 29, 2026
fe09d48
dev-lang/python: Sync with Gentoo
Jun 29, 2026
7ef0d30
dev-lang/rust: Sync with Gentoo
Jun 29, 2026
ac77207
dev-lang/rust-bin: Sync with Gentoo
Jun 29, 2026
722a8c7
dev-lang/rust-common: Sync with Gentoo
Jun 29, 2026
eb3125e
dev-lang/swig: Sync with Gentoo
Jun 29, 2026
372c259
dev-lang/tcl: Sync with Gentoo
Jun 29, 2026
146bfc0
dev-libs/expat: Sync with Gentoo
Jun 29, 2026
2140882
dev-libs/glib: Sync with Gentoo
Jun 29, 2026
e6eb938
dev-libs/gmp: Sync with Gentoo
Jun 29, 2026
6f42da2
dev-libs/jsoncpp: Sync with Gentoo
Jun 29, 2026
9bb6f40
dev-libs/libgpg-error: Sync with Gentoo
Jun 29, 2026
bfce81c
dev-libs/libksba: Sync with Gentoo
Jun 29, 2026
0ce21d7
dev-libs/libpwquality: Sync with Gentoo
Jun 29, 2026
a369016
dev-libs/libtasn1: Sync with Gentoo
Jun 29, 2026
f2150f8
dev-libs/libtraceevent: Sync with Gentoo
Jun 29, 2026
5018a44
dev-libs/libusb: Sync with Gentoo
Jun 29, 2026
9ae898f
dev-libs/libuv: Sync with Gentoo
Jun 29, 2026
605193e
dev-libs/libxml2: Sync with Gentoo
Jun 29, 2026
495993d
dev-libs/nspr: Sync with Gentoo
Jun 29, 2026
4c5f529
dev-libs/opensc: Sync with Gentoo
Jun 29, 2026
5cee346
dev-libs/openssl: Sync with Gentoo
Jun 29, 2026
eeb3483
dev-libs/protobuf: Sync with Gentoo
Jun 29, 2026
d14ebbc
dev-python/cryptography: Sync with Gentoo
Jun 29, 2026
2a7739a
dev-python/cython: Sync with Gentoo
Jun 29, 2026
0cb38f2
dev-python/distlib: Sync with Gentoo
Jun 29, 2026
cd5ca57
dev-python/docutils: Sync with Gentoo
Jun 29, 2026
8c1ce9b
dev-python/editables: Sync with Gentoo
Jun 29, 2026
56b05a0
dev-python/ensurepip-pip: Sync with Gentoo
Jun 29, 2026
347bc8e
dev-python/hatchling: Sync with Gentoo
Jun 29, 2026
b9e6b20
dev-python/idna: Sync with Gentoo
Jun 29, 2026
4f52a91
dev-python/installer: Sync with Gentoo
Jun 29, 2026
62a872c
dev-python/jaraco-functools: Sync with Gentoo
Jun 29, 2026
b794a42
dev-python/markdown-it-py: Sync with Gentoo
Jun 29, 2026
81c229a
dev-python/more-itertools: Sync with Gentoo
Jun 29, 2026
34fd251
dev-python/msgpack: Sync with Gentoo
Jun 29, 2026
f5fa45b
dev-python/packaging: Sync with Gentoo
Jun 29, 2026
af57416
dev-python/pathspec: Sync with Gentoo
Jun 29, 2026
788283e
dev-python/pip: Sync with Gentoo
Jun 29, 2026
7a0867f
dev-python/platformdirs: Sync with Gentoo
Jun 29, 2026
64f7055
dev-python/poetry-core: Sync with Gentoo
Jun 29, 2026
3fbfdd7
dev-python/requests: Sync with Gentoo
Jun 29, 2026
7570556
dev-python/setuptools-scm: Sync with Gentoo
Jun 29, 2026
7d58fac
dev-python/snakeoil: Sync with Gentoo
Jun 29, 2026
3000f37
dev-python/trove-classifiers: Sync with Gentoo
Jun 29, 2026
8321091
dev-python/vcs-versioning: Sync with Gentoo
Jun 29, 2026
89c538a
dev-util/catalyst: Sync with Gentoo
Jun 29, 2026
ad9e3f6
dev-util/gdbus-codegen: Sync with Gentoo
Jun 29, 2026
7d1691e
dev-util/glib-utils: Sync with Gentoo
Jun 29, 2026
8a8ef72
dev-util/maturin: Sync with Gentoo
Jun 29, 2026
423f42c
dev-util/patchutils: Sync with Gentoo
Jun 29, 2026
6dd1fac
dev-util/perf: Sync with Gentoo
Jun 29, 2026
43e8c83
dev-util/pkgcheck: Sync with Gentoo
Jun 29, 2026
7852c07
dev-util/pkgconf: Sync with Gentoo
Jun 29, 2026
682acca
dev-util/xdelta: Sync with Gentoo
Jun 29, 2026
53e46cb
dev-vcs/git: Sync with Gentoo
Jun 29, 2026
20a4bca
eclass/acct-user: Sync with Gentoo
Jun 29, 2026
45973ff
eclass/bash-completion-r1: Sync with Gentoo
Jun 29, 2026
09e3a87
eclass/cmake: Sync with Gentoo
Jun 29, 2026
811883f
eclass/desktop: Sync with Gentoo
Jun 29, 2026
f05ff01
eclass/dist-kernel-utils: Sync with Gentoo
Jun 29, 2026
1017b3a
eclass/distutils-r1: Sync with Gentoo
Jun 29, 2026
47f7f91
eclass/java-utils-2: Sync with Gentoo
Jun 29, 2026
6cd0d53
eclass/kernel-2: Sync with Gentoo
Jun 29, 2026
aac5b64
eclass/linux-mod: Sync with Gentoo
Jun 29, 2026
0060e82
eclass/llvm-r1: Sync with Gentoo
Jun 29, 2026
bcd367d
eclass/llvm-r2: Sync with Gentoo
Jun 29, 2026
ae62e15
eclass/mount-boot: Sync with Gentoo
Jun 29, 2026
2309e46
eclass/python-utils-r1: Sync with Gentoo
Jun 29, 2026
27bbf8d
eclass/secureboot: Sync with Gentoo
Jun 29, 2026
e1383c4
eclass/shell-completion: Sync with Gentoo
Jun 29, 2026
b6002e9
eclass/toolchain: Sync with Gentoo
Jun 29, 2026
c6c9df5
licenses: Sync with Gentoo
Jun 29, 2026
9cabf9e
media-libs/libpng: Sync with Gentoo
Jun 29, 2026
aa95955
net-dns/bind: Sync with Gentoo
Jun 29, 2026
82edf82
net-dns/dnsmasq: Sync with Gentoo
Jun 29, 2026
d789a9a
net-fs/cifs-utils: Sync with Gentoo
Jun 29, 2026
4c21912
net-fs/samba: Sync with Gentoo
Jun 29, 2026
29d5eed
net-libs/gnutls: Sync with Gentoo
Jun 29, 2026
188cc08
net-libs/libslirp: Sync with Gentoo
Jun 29, 2026
9586ce3
net-libs/nghttp2: Sync with Gentoo
Jun 29, 2026
cdb060a
net-libs/ngtcp2: Sync with Gentoo
Jun 29, 2026
cdf78eb
net-misc/chrony: Sync with Gentoo
Jun 29, 2026
463466b
net-misc/curl: Sync with Gentoo
Jun 29, 2026
06d6fb0
net-misc/iperf: Sync with Gentoo
Jun 29, 2026
77d6bf3
net-misc/iputils: Sync with Gentoo
Jun 29, 2026
75c94cc
net-misc/passt: Sync with Gentoo
Jun 29, 2026
404a3d1
net-misc/rsync: Sync with Gentoo
Jun 29, 2026
0072565
net-misc/socat: Sync with Gentoo
Jun 29, 2026
2c794bb
net-misc/wget: Sync with Gentoo
Jun 29, 2026
066e8aa
net-nds/openldap: Sync with Gentoo
Jun 29, 2026
8f4321e
profiles: Sync with Gentoo
Jun 29, 2026
aa944a7
sec-policy/selinux-base: Sync with Gentoo
Jun 29, 2026
b4720ff
sec-policy/selinux-base-policy: Sync with Gentoo
Jun 29, 2026
321a21b
sec-policy/selinux-container: Sync with Gentoo
Jun 29, 2026
8e5ea24
sec-policy/selinux-dbus: Sync with Gentoo
Jun 29, 2026
c37fc57
sec-policy/selinux-policykit: Sync with Gentoo
Jun 29, 2026
1acedc7
sec-policy/selinux-sssd: Sync with Gentoo
Jun 29, 2026
a445592
sec-policy/selinux-unconfined: Sync with Gentoo
Jun 29, 2026
3da94f6
sys-apps/acl: Sync with Gentoo
Jun 29, 2026
616b723
sys-apps/bubblewrap: Sync with Gentoo
Jun 29, 2026
fefbfc1
sys-apps/checkpolicy: Sync with Gentoo
Jun 29, 2026
ecaa839
sys-apps/coreutils: Sync with Gentoo
Jun 29, 2026
1d6273b
sys-apps/ethtool: Sync with Gentoo
Jun 29, 2026
731a8a1
sys-apps/file: Sync with Gentoo
Jun 29, 2026
d4886ff
sys-apps/gawk: Sync with Gentoo
Jun 29, 2026
28e0027
sys-apps/gentoo-functions: Sync with Gentoo
Jun 29, 2026
6dca254
sys-apps/i2c-tools: Sync with Gentoo
Jun 29, 2026
09d84a4
sys-apps/iproute2: Sync with Gentoo
Jun 29, 2026
bdbfb1b
sys-apps/kbd: Sync with Gentoo
Jun 29, 2026
de2930b
sys-apps/less: Sync with Gentoo
Jun 29, 2026
84f49ee
sys-apps/net-tools: Sync with Gentoo
Jun 29, 2026
74a7a9b
sys-apps/nvme-cli: Sync with Gentoo
Jun 29, 2026
138d04c
sys-apps/pkgcore: Sync with Gentoo
Jun 29, 2026
dbb205f
sys-apps/portage: Sync with Gentoo
Jun 29, 2026
acdf89f
sys-apps/sed: Sync with Gentoo
Jun 29, 2026
0d99cd8
sys-apps/semodule-utils: Sync with Gentoo
Jun 29, 2026
d4463c8
sys-apps/shadow: Sync with Gentoo
Jun 29, 2026
d576939
sys-apps/systemd: Sync with Gentoo
Jun 29, 2026
b086dce
sys-apps/util-linux: Sync with Gentoo
Jun 29, 2026
f6f51ff
sys-auth/sssd: Sync with Gentoo
Jun 29, 2026
8bb4987
sys-devel/binutils: Sync with Gentoo
Jun 29, 2026
0939249
sys-devel/crossdev: Sync with Gentoo
Jun 29, 2026
9c9fa60
sys-devel/gcc: Sync with Gentoo
Jun 29, 2026
4fa6739
sys-firmware/edk2-bin: Sync with Gentoo
Jun 29, 2026
f9f368e
sys-fs/btrfs-progs: Sync with Gentoo
Jun 29, 2026
3b376ef
sys-fs/lxcfs: Sync with Gentoo
Jun 29, 2026
81b8f87
sys-fs/xfsprogs: Sync with Gentoo
Jun 29, 2026
dee42bb
sys-fs/zfs: Sync with Gentoo
Jun 29, 2026
75bf5c5
sys-fs/zfs-kmod: Sync with Gentoo
Jun 29, 2026
a7e4e42
sys-kernel/dracut: Sync with Gentoo
Jun 29, 2026
58fe536
sys-kernel/linux-headers: Sync with Gentoo
Jun 29, 2026
b356fde
sys-libs/binutils-libs: Sync with Gentoo
Jun 29, 2026
c3fcff6
sys-libs/glibc: Sync with Gentoo
Jun 29, 2026
3a65baa
sys-libs/libcap: Sync with Gentoo
Jun 29, 2026
a573209
sys-libs/libcap-ng: Sync with Gentoo
Jun 29, 2026
a94515b
sys-libs/libnvme: Sync with Gentoo
Jun 29, 2026
b4fa270
sys-libs/libselinux: Sync with Gentoo
Jun 29, 2026
9ddd413
sys-libs/libsepol: Sync with Gentoo
Jun 29, 2026
def7361
sys-libs/libunwind: Sync with Gentoo
Jun 29, 2026
bcdf72a
sys-libs/liburing: Sync with Gentoo
Jun 29, 2026
a76fff3
sys-libs/libxcrypt: Sync with Gentoo
Jun 29, 2026
5bcc65e
sys-libs/talloc: Sync with Gentoo
Jun 29, 2026
ec4336f
sys-libs/tdb: Sync with Gentoo
Jun 29, 2026
fcab51a
sys-libs/timezone-data: Sync with Gentoo
Jun 29, 2026
4a25e1e
sys-process/audit: Sync with Gentoo
Jun 29, 2026
2bf93ef
virtual/libudev: Sync with Gentoo
Jun 29, 2026
0b17bdd
virtual/perl-Carp: Sync with Gentoo
Jun 29, 2026
910a5e7
virtual/perl-Encode: Sync with Gentoo
Jun 29, 2026
9063260
virtual/perl-Exporter: Sync with Gentoo
Jun 29, 2026
283269b
virtual/perl-ExtUtils-MakeMaker: Sync with Gentoo
Jun 29, 2026
49ee156
x11-drivers/nvidia-drivers: Sync with Gentoo
Jun 29, 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
@@ -1,4 +1,4 @@
# Copyright 2020-2024 Gentoo Authors
# Copyright 2020-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
Expand All @@ -13,5 +13,3 @@ ACCT_USER_HOME_PERMS=0755
ACCT_USER_GROUPS=( nobody )

acct-user_add_deps

RDEPEND+=" acct-user/root"
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