summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--sandbox-capsicum.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ebe80e5cd..5d9b9d10e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,9 @@
14 declspec(dllimport). The least intrusive way to get rid of these warnings 14 declspec(dllimport). The least intrusive way to get rid of these warnings
15 is to disable warnings for GCC compiler attributes when building on Cygwin. 15 is to disable warnings for GCC compiler attributes when building on Cygwin.
16 Patch from vinschen at redhat.com. 16 Patch from vinschen at redhat.com.
17 - (dtucker) [sandbox-capsicum.c] Correct some error messages and make the
18 return value check for cap_enter() consistent with the other uses in
19 FreeBSD. From by Loganaden Velvindron @ AfriNIC via bz#2140.
17 20
1820140117 2120140117
19 - (dtucker) [aclocal.m4 configure.ac] Add some additional compiler/toolchain 22 - (dtucker) [aclocal.m4 configure.ac] Add some additional compiler/toolchain
diff --git a/sandbox-capsicum.c b/sandbox-capsicum.c
index 5853a13ef..f648c6ece 100644
--- a/sandbox-capsicum.c
+++ b/sandbox-capsicum.c
@@ -87,9 +87,9 @@ ssh_sandbox_child(struct ssh_sandbox *box)
87 if (cap_rights_limit(STDIN_FILENO, &rights) < 0 && errno != ENOSYS) 87 if (cap_rights_limit(STDIN_FILENO, &rights) < 0 && errno != ENOSYS)
88 fatal("can't limit stdin: %m"); 88 fatal("can't limit stdin: %m");
89 if (cap_rights_limit(STDOUT_FILENO, &rights) < 0 && errno != ENOSYS) 89 if (cap_rights_limit(STDOUT_FILENO, &rights) < 0 && errno != ENOSYS)
90 fatal("can't limit stdin: %m"); 90 fatal("can't limit stdout: %m");
91 if (cap_rights_limit(STDERR_FILENO, &rights) < 0 && errno != ENOSYS) 91 if (cap_rights_limit(STDERR_FILENO, &rights) < 0 && errno != ENOSYS)
92 fatal("can't limit stdin: %m"); 92 fatal("can't limit stderr: %m");
93 93
94 cap_rights_init(&rights, CAP_READ, CAP_WRITE); 94 cap_rights_init(&rights, CAP_READ, CAP_WRITE);
95 if (cap_rights_limit(box->monitor->m_recvfd, &rights) == -1) 95 if (cap_rights_limit(box->monitor->m_recvfd, &rights) == -1)
@@ -97,7 +97,7 @@ ssh_sandbox_child(struct ssh_sandbox *box)
97 cap_rights_init(&rights, CAP_WRITE); 97 cap_rights_init(&rights, CAP_WRITE);
98 if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) == -1) 98 if (cap_rights_limit(box->monitor->m_log_sendfd, &rights) == -1)
99 fatal("%s: failed to limit the logging socket", __func__); 99 fatal("%s: failed to limit the logging socket", __func__);
100 if (cap_enter() != 0 && errno != ENOSYS) 100 if (cap_enter() < 0 && errno != ENOSYS)
101 fatal("%s: failed to enter capability mode", __func__); 101 fatal("%s: failed to enter capability mode", __func__);
102 102
103} 103}