rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(execve), 1,
SCMP_CMP(0, SCMP_CMP_EQ, elem->param));
if (rc != 0) {
- log_err(LD_BUG,"(Sandbox) failed to add execve syscall, received libseccomp "
- "error %d", rc);
+ log_err(LD_BUG,"(Sandbox) failed to add execve syscall, received "
+ "libseccomp error %d", rc);
return rc;
}
}
rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 1,
SCMP_CMP(0, SCMP_CMP_EQ, elem->param));
if (rc != 0) {
- log_err(LD_BUG,"(Sandbox) failed to add open syscall, received libseccomp "
- "error %d", rc);
+ log_err(LD_BUG,"(Sandbox) failed to add open syscall, received "
+ "libseccomp error %d", rc);
return rc;
}
}
return 0;
}
-static int sb_getsockopt(scmp_filter_ctx ctx, sandbox_cfg_t *filter)
+static int
+sb_getsockopt(scmp_filter_ctx ctx, sandbox_cfg_t *filter)
{
int rc = 0;
rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(stat64), 1,
SCMP_CMP(0, SCMP_CMP_EQ, elem->param));
if (rc != 0) {
- log_err(LD_BUG,"(Sandbox) failed to add open syscall, received libseccomp "
- "error %d", rc);
+ log_err(LD_BUG,"(Sandbox) failed to add open syscall, received "
+ "libseccomp error %d", rc);
return rc;
}
}
char fr = (char) va_arg(ap, int);
rc = sandbox_cfg_allow_stat64_filename(cfg, fn, fr);
- if(rc) {
+ if (rc) {
log_err(LD_BUG,"(Sandbox) failed on par %d", i);
goto end;
}
char fr = (char) va_arg(ap, int);
rc = sandbox_cfg_allow_open_filename(cfg, fn, fr);
- if(rc) {
+ if (rc) {
log_err(LD_BUG,"(Sandbox) failed on par %d", i);
goto end;
}
char fr = (char) va_arg(ap, int);
rc = sandbox_cfg_allow_openat_filename(cfg, fn, fr);
- if(rc) {
+ if (rc) {
log_err(LD_BUG,"(Sandbox) failed on par %d", i);
goto end;
}
rc = sandbox_cfg_allow_execve(cfg, fn);
- if(rc) {
+ if (rc) {
log_err(LD_BUG,"(Sandbox) failed on par %d", i);
goto end;
}
return 0;
}
-int sandbox_getaddrinfo(const char *name, struct addrinfo **res)
+int
+sandbox_getaddrinfo(const char *name, struct addrinfo **res)
{
char hname[256];
return -2;
}
*res = NULL;
- *res = (struct addrinfo *) malloc (sizeof(struct addrinfo));
+ *res = (struct addrinfo *)malloc(sizeof(struct addrinfo));
if (!res) {
return -2;
}
hints.ai_socktype = SOCK_STREAM;
ret = getaddrinfo(hname, NULL, &hints, &sb_addr_info);
- if(ret) {
+ if (ret) {
sb_addr_info = NULL;
return -2;
}
return 0;
}
-static int register_cfg(sandbox_cfg_t* cfg) {
+static int
+register_cfg(sandbox_cfg_t* cfg)
+{
sandbox_cfg_t *elem = NULL;
if (filter_dynamic == NULL) {