From owner-svn-src-all@freebsd.org Sun Nov 12 07:18:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E8B0E6AE5C; Sun, 12 Nov 2017 07:18:12 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 282567F64F; Sun, 12 Nov 2017 07:18:12 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAC7IBaC073438; Sun, 12 Nov 2017 07:18:11 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAC7IB3A073436; Sun, 12 Nov 2017 07:18:11 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201711120718.vAC7IB3A073436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 12 Nov 2017 07:18:11 +0000 (UTC) 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 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: lib/libcasper/libcasper sbin/ping X-SVN-Commit-Revision: 325736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Nov 2017 07:18:12 -0000 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;