Bug ID 1173615
Summary Logrotate not rotating files due to seteuid issues
Classification openSUSE
Product openSUSE Distribution
Version Leap 15.2
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Other
Assignee screening-team-bugs@suse.de
Reporter opensuse@1.opensuse.bgcomp.co.uk
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

Logrotate is complaining about permission problems...

root@eth7 # /usr/sbin/logrotate /etc/logrotate.conf
error: unable to open /var/log/warn-20200326 for compression
error: unable to open /var/log/messages-20200609 for compression
error: unable to open /var/log/systemd.log-20200628 for compression

applying -v or -d switch does not show access to these files as they would
require writing and those switched do not allow that.

However, strace produces the following, which shoes that around accessing the
warn-20200326 file, just previous, it processed the radius log files and as
such it switched user to radiusd, however, it never switched back to root which
would be required to update files in the /var/log directory, hence the
permission problem.


15637 setresgid(-1, 476, -1)            = 0
15637 setresuid(-1, 477, -1)            = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/radius/radacct/*/detail", 0x7ffca23ec870) = -1 ENOENT (No
such file or directory)
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 getegid()                         = 476
15637 geteuid()                         = 477
15637 setresgid(-1, 0, -1)              = 0
15637 setresuid(-1, 0, -1)              = 0
15637 getegid()                         = 0
15637 geteuid()                         = 0
15637 setresgid(-1, 476, -1)            = 0
15637 setresuid(-1, 477, -1)            = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/rkhunter.log", {st_mode=S_IFREG|0644, st_size=719183,
...}) = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 getegid()                         = 476
15637 geteuid()                         = 477
15637 setresgid(-1, 0, -1)              = 0
15637 setresuid(-1, 0, -1)              = 0
15637 getegid()                         = 0
15637 geteuid()                         = 0
15637 setresgid(-1, 476, -1)            = 0
15637 setresuid(-1, 477, -1)            = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/rsyncd.log", 0x7ffca23ec870) = -1 ENOENT (No such file or
directory)
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 getegid()                         = 476
15637 geteuid()                         = 477
15637 setresgid(-1, 0, -1)              = 0
15637 setresuid(-1, 0, -1)              = 0
15637 getegid()                         = 0
15637 geteuid()                         = 0
15637 setresgid(-1, 476, -1)            = 0
15637 setresuid(-1, 477, -1)            = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/snapper.log", {st_mode=S_IFREG|0640, st_size=2288651,
...}) = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 getegid()                         = 476
15637 geteuid()                         = 477
15637 setresgid(-1, 0, -1)              = 0
15637 setresuid(-1, 0, -1)              = 0
15637 getegid()                         = 0
15637 geteuid()                         = 0
15637 setresgid(-1, 476, -1)            = 0
15637 setresuid(-1, 477, -1)            = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/warn", {st_mode=S_IFREG|0640, st_size=4501244, ...}) = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/messages", {st_mode=S_IFREG|0640, st_size=5453451, ...})
= 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/allmessages", 0x7ffca23ec870) = -1 ENOENT (No such file
or directory)
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/localmessages", {st_mode=S_IFREG|0640, st_size=3769569,
...}) = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/firewall", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/acpid", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/NetworkManager", {st_mode=S_IFREG|0640, st_size=0, ...})
= 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/mail", {st_mode=S_IFREG|0640, st_size=2383512, ...}) = 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/mail.info", {st_mode=S_IFREG|0640, st_size=1500471, ...})
= 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/mail.warn", {st_mode=S_IFREG|0640, st_size=1949338, ...})
= 0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/mail.err", {st_mode=S_IFREG|0640, st_size=68695, ...}) =
0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/news/news.crit", 0x7ffca23ec870) = -1 ENOENT (No such
file or directory)
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/news/news.err", 0x7ffca23ec870) = -1 ENOENT (No such file
or directory)
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/news/news.notice", 0x7ffca23ec870) = -1 ENOENT (No such
file or directory)
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 lstat("/var/log/cisco2", {st_mode=S_IFREG|0640, st_size=2621839, ...}) =
0
15637 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3648, ...}) = 0
15637 openat(AT_FDCWD, "/var/log/warn", O_RDONLY|O_NOFOLLOW) = 3
15637 close(3)                          = 0
15637 open("/var/log", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
15637 fstat(3, {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
15637 getdents(3, /* 387 entries */, 32768) = 15832
15637 getdents(3, /* 0 entries */, 32768) = 0
15637 close(3)                          = 0
15637 stat("/var/log/warn-20200326", {st_mode=S_IFREG|0640, st_size=6650340,
...}) = 0
15637 openat(AT_FDCWD, "/var/log/warn-20200326", O_RDWR|O_NOFOLLOW) = -1 EACCES
(Permission denied)
15637 write(2, "error: ", 7)            = 7
15637 write(2, "unable to open /var/log/warn-202"..., 54) = 54
15637 open("/var/log", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
15637 fstat(3, {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
15637 getdents(3, /* 387 entries */, 32768) = 15832
15637 getdents(3, /* 0 entries */, 32768) = 0
15637 close(3)                          = 0


You are receiving this mail because: