Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Feb 2025 14:47:04 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: dff74bbdd060 - stable/14 - savecore: add missing call to cap_openlog when in capabilities mode
Message-ID:  <202502071447.517El4pG002893@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=dff74bbdd060e31fe790767ddd45e4e789495144

commit dff74bbdd060e31fe790767ddd45e4e789495144
Author:     Stéphane Rochoy <stephane.rochoy@stormshield.eu>
AuthorDate: 2024-12-11 13:39:36 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-02-07 14:46:53 +0000

    savecore: add missing call to cap_openlog when in capabilities mode
    
    Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu>
    
    Reviewed by:    markj, oshogbo
    MFC after:      2 weeks
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1546
    
    (cherry picked from commit c901e89d8e467b56f844ab5dba18dc20d503c2be)
---
 sbin/savecore/savecore.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c
index a571144589bb..2dcf279cb1c8 100644
--- a/sbin/savecore/savecore.c
+++ b/sbin/savecore/savecore.c
@@ -102,6 +102,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 */
@@ -1408,6 +1411,7 @@ init_caps(int argc, char **argv)
 		exit(1);
 	}
 	cap_close(capcas);
+	cap_openlog(capsyslog, "savecore", LOG_OPTIONS, LOG_FACILITY);
 }
 
 static void
@@ -1435,7 +1439,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502071447.517El4pG002893>