Skip to content

Commit

Permalink
savecore: add missing call to cap_openlog when in capabilities mode
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>
  • Loading branch information
stephane-rochoy-stormshield committed Dec 12, 2024
1 parent dfd5232 commit 3d688bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sbin/savecore/savecore.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
#define STATUS_GOOD 1
#define STATUS_UNKNOWN 2

#define LOG_OPTIONS LOG_PERROR
#define LOG_FACILITY LOG_DAEMON

static cap_channel_t *capsyslog;
static fileargs_t *capfa;
static bool checkfor, compress, uncompress, clear, force, keep; /* flags */
Expand Down Expand Up @@ -1409,6 +1412,7 @@ init_caps(int argc, char **argv)
exit(EXIT_FAILURE);
}
cap_close(capcas);
cap_openlog(capsyslog, "savecore", LOG_OPTIONS, LOG_FACILITY);
}

static void
Expand Down Expand Up @@ -1436,7 +1440,7 @@ main(int argc, char **argv)
savedir = ".";
comp_desired = KERNELDUMP_COMP_NONE;

openlog("savecore", LOG_PERROR, LOG_DAEMON);
openlog("savecore", LOG_OPTIONS, LOG_FACILITY);
signal(SIGINFO, infohandler);

argc = xo_parse_args(argc, argv);
Expand Down

0 comments on commit 3d688bd

Please sign in to comment.