summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-05-12 23:43:47 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-05-12 23:43:47 +0000
commit7017c7631eafee5b752904064a6d0daec94f32d9 (patch)
tree53f75bb46ff3c00fb2562f7e8cbf5786e956b022
parent9c5a0cad586dc18e33d6af69755d2f760e3dadc4 (diff)
downloads6-7017c7631eafee5b752904064a6d0daec94f32d9.tar.xz
Better error message when s6-sudoc gets punted by s6-ipcserver-access
-rw-r--r--src/conn-tools/s6-sudoc.c8
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 } ;