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
This commit is contained in:
oshogbo 2017-11-12 07:18:10 +00:00
parent d1f8082780
commit fff97aa66a
2 changed files with 3 additions and 1 deletions

View File

@ -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 */

View File

@ -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;