/* Copy all permitted caps to the inheritable set */
dbgmsg[0] = '\0';
for (size_t i = 0; i < ARRAYSIZE(capNames); i++) {
- if (capsGetPermitted(cap_data, capNames[i].val) == true) {
+ if (capsGetPermitted(cap_data, capNames[i].val)) {
utilSSnPrintf(dbgmsg, sizeof(dbgmsg), " %s", capNames[i].name);
capsSetInheritable(cap_data, capNames[i].val);
}
* Make sure all other caps (those which were not explicitly requested) are removed from the
* bounding set. We need to have CAP_SETPCAP to do that now
*/
- if (capsGetEffective(cap_data, CAP_SETPCAP) == true) {
+ if (capsGetEffective(cap_data, CAP_SETPCAP)) {
dbgmsg[0] = '\0';
for (size_t i = 0; i < ARRAYSIZE(capNames); i++) {
- if (capsGetInheritable(cap_data, capNames[i].val) == true) {
+ if (capsGetInheritable(cap_data, capNames[i].val)) {
continue;
}
utilSSnPrintf(dbgmsg, sizeof(dbgmsg), " %s", capNames[i].name);
static bool containMakeFdsCOE(struct nsjconf_t* nsjconf)
{
- if (containMakeFdsCOEProc(nsjconf) == true) {
+ if (containMakeFdsCOEProc(nsjconf)) {
return true;
}
- if (containMakeFdsCOENaive(nsjconf) == true) {
+ if (containMakeFdsCOENaive(nsjconf)) {
return true;
}
LOG_E("Couldn't mark relevant file-descriptors as close-on-exec with any known method");
log_fd = nsjconf->log_fd;
log_level = nsjconf->loglevel;
- if (nsjconf->logfile == NULL && nsjconf->daemonize == true) {
+ if (nsjconf->logfile == NULL && nsjconf->daemonize) {
nsjconf->logfile = _LOG_DEFAULT_FILE;
}
if (nsjconf->logfile == NULL) {
}
char strerr[512];
- if (perr == true) {
+ if (perr) {
snprintf(strerr, sizeof(strerr), "%s", strerror(errno));
}
struct ll_t {
va_start(args, fmt);
vdprintf(log_fd, fmt, args);
va_end(args);
- if (perr == true) {
+ if (perr) {
dprintf(log_fd, ": %s", strerr);
}
if (log_fd_isatty) {
close(listenfd);
return;
}
- if (nsjailShowProc == true) {
+ if (nsjailShowProc) {
nsjailShowProc = false;
subprocDisplay(nsjconf);
}
subprocRunChild(nsjconf, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO);
continue;
}
- if (nsjailShowProc == true) {
+ if (nsjailShowProc) {
nsjailShowProc = false;
subprocDisplay(nsjconf);
}
if (WIFEXITED(status)) {
int exit_code = WEXITSTATUS(status);
LOG_D("PID %d exited with exit code: %d", pid, exit_code);
- if (exec_failed == true) {
+ if (exec_failed) {
return -1;
} else if (exit_code == 0) {
return 0;