Date: Wed, 3 Jan 2018 07:43:04 +0000 (UTC) From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327513 - head/usr.bin/kdump Message-ID: <201801030743.w037h4Lq030523@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oshogbo Date: Wed Jan 3 07:43:04 2018 New Revision: 327513 URL: https://svnweb.freebsd.org/changeset/base/327513 Log: NLS data and tz can be cached using caspicum helpers. Using them we simplifies and unifies sandboxed code. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Wed Jan 3 06:41:39 2018 (r327512) +++ head/usr.bin/kdump/kdump.c Wed Jan 3 07:43:04 2018 (r327513) @@ -175,34 +175,7 @@ static TAILQ_HEAD(trace_procs, proc_info) trace_procs; #ifdef WITH_CASPER static cap_channel_t *cappwd, *capgrp; -#endif -static void -strerror_init(void) -{ - - /* - * Cache NLS data before entering capability mode. - * XXXPJD: There should be strerror_init() and strsignal_init() in libc. - */ - (void)catopen("libc", NL_CAT_LOCALE); -} - -static void -localtime_init(void) -{ - time_t ltime; - - /* - * Allow localtime(3) to cache /etc/localtime content before entering - * capability mode. - * XXXPJD: There should be localtime_init() in libc. - */ - (void)time(<ime); - (void)localtime(<ime); -} - -#ifdef WITH_CASPER static int cappwdgrp_setup(cap_channel_t **cappwdp, cap_channel_t **capgrpp) { @@ -450,8 +423,9 @@ main(int argc, char *argv[]) if (!freopen(tracefile, "r", stdin)) err(1, "%s", tracefile); - strerror_init(); - localtime_init(); + caph_cache_catpages(); + caph_cache_tzdata(); + #ifdef WITH_CASPER if (resolv != 0) { if (cappwdgrp_setup(&cappwd, &capgrp) < 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801030743.w037h4Lq030523>