From owner-svn-src-all@freebsd.org Sun Jul 15 17:21:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D0C10479BC; Sun, 15 Jul 2018 17:21:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 372D18F86E; Sun, 15 Jul 2018 17:21:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1804210E34; Sun, 15 Jul 2018 17:21:20 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6FHLJx4086043; Sun, 15 Jul 2018 17:21:19 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6FHLJQs086041; Sun, 15 Jul 2018 17:21:19 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201807151721.w6FHLJQs086041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 15 Jul 2018 17:21:19 +0000 (UTC) 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 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/usr.sbin: fstyp uefisign X-SVN-Commit-Revision: 336307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2018 17:21:20 -0000 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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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));