Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2018 12:32:53 +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: r329453 - head/bin/uuidgen
Message-ID:  <201802171232.w1HCWr8N002233@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: oshogbo
Date: Sat Feb 17 12:32:53 2018
New Revision: 329453
URL: https://svnweb.freebsd.org/changeset/base/329453

Log:
  Capsicumize uuidgen.

Modified:
  head/bin/uuidgen/uuidgen.c

Modified: head/bin/uuidgen/uuidgen.c
==============================================================================
--- head/bin/uuidgen/uuidgen.c	Sat Feb 17 12:22:29 2018	(r329452)
+++ head/bin/uuidgen/uuidgen.c	Sat Feb 17 12:32:53 2018	(r329453)
@@ -28,6 +28,9 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/capsicum.h>
+
+#include <capsicum_helpers.h>
 #include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -79,6 +82,12 @@ main(int argc, char *argv[])
 
 	if (argc)
 		usage();
+
+	caph_cache_catpages();
+	if (caph_limit_stdio() < 0)
+		err(1, "Unable to limit stdio");
+	if (cap_enter() < 0 && errno != ENOSYS)
+		err(1, "Unable to enter capability mode");
 
 	if (count == -1)
 		count = 1;



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