diff options
Diffstat (limited to 'src/conn-tools/s6-sudoc.c')
-rw-r--r-- | src/conn-tools/s6-sudoc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/conn-tools/s6-sudoc.c b/src/conn-tools/s6-sudoc.c index eb8f138..18851e0 100644 --- a/src/conn-tools/s6-sudoc.c +++ b/src/conn-tools/s6-sudoc.c @@ -56,11 +56,15 @@ int main (int argc, char const *const *argv, char const *const *envp) tain_now_g() ; tain_add_g(&deadline, &deadline) ; { + size_t r ; char tmp[S6_SUDO_BANNERB_LEN] ; - if (buffer_timed_get_g(&b6, tmp, S6_SUDO_BANNERB_LEN, &deadline) < S6_SUDO_BANNERB_LEN) + r = buffer_timed_get_g(&b6, tmp, S6_SUDO_BANNERB_LEN, &deadline) ; + if (!r) + strerr_dief1x(111, "connect to the s6-sudod server - check that you have appropriate permissions") ; + if (r < S6_SUDO_BANNERB_LEN) strerr_diefu1sys(111, "read banner from s6-sudod") ; if (strncmp(tmp, S6_SUDO_BANNERB, S6_SUDO_BANNERB_LEN)) - strerr_dief1x(100, "wrong server banner") ; + strerr_dief1x(100, "wrong banner - check that you are connecting to a s6-sudod server") ; } { int fds[3] = { 0, 1, 2 } ; |