libvirt/src/logging
Michal Privoznik a57195e79e log_cleaner: Detect rotated filenames properly
When removing rotated log files, their name is matched against a
regex (@log_regex) and if they contain '.N' suffix the 'N' is
then parsed into an integer. Well, due to a bug in
virLogCleanerParseFilename() this is not how the code works. If
the suffix isn't found then g_match_info_fetch() returns an empty
string instead of NULL which then makes str2int parsing fail.
Just check for this case before parsing the string.

Based on the original patch sent by David.

Reported-by: David Negreira <david.negreira@canonical.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-05-31 08:34:29 +02:00
..
log_cleaner.c
log_cleaner.h
log_daemon_config.c
log_daemon_config.h
log_daemon_dispatch.c
log_daemon_dispatch.h
log_daemon.c
log_daemon.h
log_handler.c
log_handler.h
log_manager.c
log_manager.h
log_protocol.x
meson.build
test_virtlogd.aug.in
virtlogd-admin.socket.in
virtlogd.aug
virtlogd.conf
virtlogd.init.in
virtlogd.service.extra.in
virtlogd.service.in
virtlogd.socket.extra.in
virtlogd.socket.in