1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Use capsicum helpers in fstype and ctld.

Reviewed by:	trasz
This commit is contained in:
Mariusz Zaborski 2018-07-15 17:21:19 +00:00
parent f1fe1e020f
commit 1afab1fe21
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336307
2 changed files with 4 additions and 5 deletions

View File

@ -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)

View File

@ -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 pipefd,
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));