diff options
Diffstat (limited to 'src/libunixonacid/skaclient_start_cb.c')
-rw-r--r-- | src/libunixonacid/skaclient_start_cb.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libunixonacid/skaclient_start_cb.c b/src/libunixonacid/skaclient_start_cb.c index 4a82b9b..ff11a21 100644 --- a/src/libunixonacid/skaclient_start_cb.c +++ b/src/libunixonacid/skaclient_start_cb.c @@ -3,16 +3,24 @@ #include <errno.h> #include <skalibs/bytestr.h> #include <skalibs/error.h> -#include <skalibs/skaclient.h> #include <skalibs/unixmessage.h> +#include <skalibs/skaclient.h> #include "skaclient-internal.h" int skaclient_start_cb (unixmessage_t const *m, skaclient_cbdata_t *blah) { if (m->len != blah->afterlen || byte_diff(m->s, m->len, blah->after) - || m->nfds != 1) return (errno = EPROTO, 0) ; - blah->asyncin->fd = m->fds[0] ; - blah->asyncout->fd = m->fds[0] ; + || m->nfds != 1) + { + unixmessage_drop(m) ; + return (errno = EPROTO, 0) ; + } + blah->a->asyncin.fd = m->fds[0] ; + blah->a->asyncout.fd = m->fds[0] ; + if (!(blah->a->options & SKACLIENT_OPTION_ASYNC_ACCEPT_FDS)) + unixmessage_receiver_refuse_fds(&blah->a->asyncin) ; + if (!(blah->a->options & SKACLIENT_OPTION_SYNC_ACCEPT_FDS)) + unixmessage_receiver_refuse_fds(&blah->a->syncin) ; return 1 ; } |