Author: markj
Date: Mon Sep 30 16:10:42 2019
New Revision: 352907
URL: https://svnweb.freebsd.org/changeset/base/352907

Log:
  Capsicumize c++filt(1).
  
  Reviewed by:  emaste
  Discussed with:       oshogbo
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D21106

Modified:
  head/contrib/elftoolchain/cxxfilt/cxxfilt.c

Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c
==============================================================================
--- head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Sep 30 15:59:07 2019        
(r352906)
+++ head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Sep 30 16:10:42 2019        
(r352907)
@@ -25,6 +25,8 @@
  */
 
 #include <sys/param.h>
+
+#include <capsicum_helpers.h>
 #include <ctype.h>
 #include <err.h>
 #include <getopt.h>
@@ -164,6 +166,11 @@ main(int argc, char **argv)
 
        argv += optind;
        argc -= optind;
+
+       if (caph_limit_stdio() < 0)
+               err(EXIT_FAILURE, "failed to limit stdio rights");
+       if (caph_enter() < 0)
+               err(EXIT_FAILURE, "failed to enter capability mode");
 
        if (*argv != NULL) {
                for (n = 0; n < argc; n++) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to