svn commit: r325736 - in head: lib/libcasper/libcasper sbin/ping

Mariusz Zaborski oshogbo at FreeBSD.org
Sun Nov 12 07:18:12 UTC 2017


Author: oshogbo
Date: Sun Nov 12 07:18:10 2017
New Revision: 325736
URL: https://svnweb.freebsd.org/changeset/base/325736

Log:
  We return a pointer when we are using cap_init() or cap_service_open()
  function, so check if cap_chanel_t is NULL is not enough.
  Casper with a normal libc will still fail in capability mote so let's not
  enter capability mode without casper support when we need to resolve DNS.
  
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D12823

Modified:
  head/lib/libcasper/libcasper/libcasper.h
  head/sbin/ping/ping.c

Modified: head/lib/libcasper/libcasper/libcasper.h
==============================================================================
--- head/lib/libcasper/libcasper/libcasper.h	Sun Nov 12 03:28:47 2017	(r325735)
+++ head/lib/libcasper/libcasper/libcasper.h	Sun Nov 12 07:18:10 2017	(r325736)
@@ -56,11 +56,13 @@ typedef struct nvlist nvlist_t;
 struct cap_channel;
 
 typedef struct cap_channel cap_channel_t;
+#define	CASPER_SUPPORT	(1)
 #else
 struct cap_channel {
 	int cch_fd;
 };
 typedef struct cap_channel cap_channel_t;
+#define	CASPER_SUPPORT	(0)
 #endif /* ! WITH_CASPER */
 #endif /* ! _CAP_CHANNEL_T_DECLARED */
 

Modified: head/sbin/ping/ping.c
==============================================================================
--- head/sbin/ping/ping.c	Sun Nov 12 03:28:47 2017	(r325735)
+++ head/sbin/ping/ping.c	Sun Nov 12 07:18:10 2017	(r325736)
@@ -709,7 +709,7 @@ main(int argc, char *const *argv)
 	if (options & F_NUMERIC)
 		cansandbox = true;
 	else if (capdns != NULL)
-		cansandbox = true;
+		cansandbox = CASPER_SUPPORT;
 	else
 		cansandbox = false;
 


More information about the svn-src-head mailing list