summaryrefslogtreecommitdiff
path: root/sandbox-capsicum.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-02-05 10:33:45 +1100
committerDamien Miller <djm@mindrot.org>2014-02-05 10:33:45 +1100
commita0959da3680b4ce8cf911caf3293a6d90f88eeb7 (patch)
treecbc13067da71e7b437546061fe41b6881af251bf /sandbox-capsicum.c
parent9c449bc183b256c84d8f740727b0bc54d247b15e (diff)
- (djm) [sandbox-capsicum.c] Don't fatal if Capsicum is offered by
headers/libc but not supported by the kernel. Patch from Loganaden Velvindron @ AfriNIC
Diffstat (limited to 'sandbox-capsicum.c')
-rw-r--r--sandbox-capsicum.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sandbox-capsicum.c b/sandbox-capsicum.c
index ee2a7e79e..655f0d217 100644
--- a/sandbox-capsicum.c
+++ b/sandbox-capsicum.c
@@ -94,10 +94,12 @@ ssh_sandbox_child(struct ssh_sandbox *box)
94 fatal("can't limit stderr: %m"); 94 fatal("can't limit stderr: %m");
95 95
96 cap_rights_init(&rights, CAP_READ, CAP_WRITE); 96 cap_rights_init(&rights, CAP_READ, CAP_WRITE);
97 if (cap_rights_limit(box->monitor->m_recvfd, &rights) == -1) 97 if (cap_rights_limit(box->monitor->m_recvfd, &rights) < 0 &&
98 errno != ENOSYS)
98 fatal("%s: failed to limit the network socket", __func__); 99 fatal("%s: failed to limit the network socket", __func__);
99 cap_rights_init(&rights, CAP_WRITE); 100 cap_rights_init(&rights, CAP_WRITE);
100 if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) == -1) 101 if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) < 0 &&
102 errno != ENOSYS)
101 fatal("%s: failed to limit the logging socket", __func__); 103 fatal("%s: failed to limit the logging socket", __func__);
102 if (cap_enter() < 0 && errno != ENOSYS) 104 if (cap_enter() < 0 && errno != ENOSYS)
103 fatal("%s: failed to enter capability mode", __func__); 105 fatal("%s: failed to enter capability mode", __func__);