Date: Sun, 15 Jul 2018 17:21:19 +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: r336307 - in head/usr.sbin: fstyp uefisign Message-ID: <201807151721.w6FHLJQs086041@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oshogbo Date: Sun Jul 15 17:21:19 2018 New Revision: 336307 URL: https://svnweb.freebsd.org/changeset/base/336307 Log: Use capsicum helpers in fstype and ctld. Reviewed by: trasz Modified: head/usr.sbin/fstyp/fstyp.c head/usr.sbin/uefisign/child.c Modified: head/usr.sbin/fstyp/fstyp.c ============================================================================== --- head/usr.sbin/fstyp/fstyp.c Sun Jul 15 17:10:12 2018 (r336306) +++ head/usr.sbin/fstyp/fstyp.c Sun Jul 15 17:21:19 2018 (r336307) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/disk.h> #include <sys/ioctl.h> #include <sys/stat.h> +#include <capsicum_helpers.h> #include <err.h> #include <errno.h> #include <stdbool.h> @@ -191,8 +192,7 @@ main(int argc, char **argv) if (fp == NULL) err(1, "%s", path); - error = cap_enter(); - if (error != 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); if (ignore_type == false) Modified: head/usr.sbin/uefisign/child.c ============================================================================== --- head/usr.sbin/uefisign/child.c Sun Jul 15 17:10:12 2018 (r336306) +++ head/usr.sbin/uefisign/child.c Sun Jul 15 17:21:19 2018 (r336307) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/stat.h> #include <assert.h> +#include <capsicum_helpers.h> #include <err.h> #include <errno.h> #include <stdio.h> @@ -228,7 +229,6 @@ int child(const char *inpath, const char *outpath, int pipefd, bool Vflag, bool vflag) { - int error; FILE *outfp = NULL, *infp = NULL; struct executable *x; @@ -236,8 +236,7 @@ child(const char *inpath, const char *outpath, int pip if (outpath != NULL) outfp = checked_fopen(outpath, "w"); - error = cap_enter(); - if (error != 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); x = calloc(1, sizeof(*x));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807151721.w6FHLJQs086041>