# HG changeset patch # User Roy Marples # Date 1600559016 -3600 # Node ID f23587f4e8e264652cd9947e2aaf7a079f26a044 # Parent 6e80b8c6f70c7ddf19648885361b182bf358b752 privsep: Don't be noisy about the sandbox diff -r 6e80b8c6f70c -r f23587f4e8e2 src/privsep.c --- a/src/privsep.c Sun Sep 20 00:35:08 2020 +0100 +++ b/src/privsep.c Sun Sep 20 00:43:36 2020 +0100 @@ -493,27 +493,27 @@ ps_entersandbox(const char *_pledge, const char **sandbox) { -#ifdef HAVE_CAPSICUM +#if !defined(HAVE_PLEDGE) + UNUSED(_pledge); +#endif + +#if defined(HAVE_CAPSICUM) if (sandbox != NULL) *sandbox = "capsicum"; return cap_enter(); -#endif -#ifdef HAVE_PLEDGE +#elif defined(HAVE_PLEDGE) if (sandbox != NULL) *sandbox = "pledge"; return pledge(_pledge, NULL); -#else - UNUSED(_pledge); -#endif -#ifdef HAVE_SECCOMP +#elif defined(HAVE_SECCOMP) if (sandbox != NULL) *sandbox = "seccomp"; return ps_seccomp_enter(); -#endif - +#else if (sandbox != NULL) - *sandbox = NULL; + *sandbox = "posix resource limited"; return 0; +#endif } int @@ -545,8 +545,8 @@ } logerr("%s: %s", __func__, sandbox); return -1; - } else if (sandbox != NULL) - loginfox("sandbox: %s", sandbox); + } else + logdebugx("sandbox: %s", sandbox); return 0; }