From owner-svn-src-all@freebsd.org Mon Jun 25 11:44:42 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 82FDA1009B72; Mon, 25 Jun 2018 11:44:42 +0000 (UTC) (envelope-from eadler@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 30B0E78F68; Mon, 25 Jun 2018 11:44:42 +0000 (UTC) (envelope-from eadler@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 115C02CB7F; Mon, 25 Jun 2018 11:44:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5PBif3v033346; Mon, 25 Jun 2018 11:44:41 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5PBifos033344; Mon, 25 Jun 2018 11:44:41 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806251144.w5PBifos033344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 25 Jun 2018 11:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335636 - in head: lib/libcasper/libcasper usr.bin/users X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: lib/libcasper/libcasper usr.bin/users X-SVN-Commit-Revision: 335636 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.26 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: Mon, 25 Jun 2018 11:44:42 -0000 Author: eadler Date: Mon Jun 25 11:44:41 2018 New Revision: 335636 URL: https://svnweb.freebsd.org/changeset/base/335636 Log: users(1): Use capsicum helpers for users In doing so also fix the libcasper.h header to work in C++. Modified: head/lib/libcasper/libcasper/libcasper.h head/usr.bin/users/users.cc Modified: head/lib/libcasper/libcasper/libcasper.h ============================================================================== --- head/lib/libcasper/libcasper/libcasper.h Mon Jun 25 11:29:04 2018 (r335635) +++ head/lib/libcasper/libcasper/libcasper.h Mon Jun 25 11:44:41 2018 (r335636) @@ -105,7 +105,7 @@ cap_init(void) { cap_channel_t *chan; - chan = malloc(sizeof(*chan)); + chan = (cap_channel_t *)malloc(sizeof(*chan)); if (chan != NULL) { chan->cch_fd = -1; } Modified: head/usr.bin/users/users.cc ============================================================================== --- head/usr.bin/users/users.cc Mon Jun 25 11:29:04 2018 (r335635) +++ head/usr.bin/users/users.cc Mon Jun 25 11:44:41 2018 (r335636) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -56,7 +57,7 @@ main(int argc, char **) setutxent(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter()) err(1, "Failed to enter capability mode."); while ((ut = getutxent()) != NULL)