Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2018 11:44:41 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
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
Message-ID:  <201806251144.w5PBifos033344@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/capsicum.h>
 
+#include <capsicum_helpers.h>
 #include <err.h>
 #include <errno.h>
 #include <utmpx.h>
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806251144.w5PBifos033344>