Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2017 07:18:11 +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: r325736 - in head: lib/libcasper/libcasper sbin/ping
Message-ID:  <201711120718.vAC7IB3A073436@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



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