diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | sandbox-capsicum.c | 6 |
2 files changed, 6 insertions, 3 deletions
@@ -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 | ||
18 | 20140117 | 21 | 20140117 |
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 | } |