Commit 36b18199 authored by Niels Möller's avatar Niels Möller
Browse files

(do_exc_lshd_handler): It seems we need an exception

handler after all, which catches and logs i/o errors.

Rev: src/lshd.c:1.156
parent 28787aaa
...@@ -817,6 +817,22 @@ install_signal_handlers(struct resource *resource) ...@@ -817,6 +817,22 @@ install_signal_handlers(struct resource *resource)
make_sighup_close_callback(resource)); make_sighup_close_callback(resource));
} }
static void
do_exc_lshd_handler(struct exception_handler *self,
const struct exception *e)
{
if (e->type & EXC_IO)
{
CAST_SUBTYPE(io_exception, exc, e);
werror("%z, (errno = %i)\n", e->msg, exc->error);
}
else
EXCEPTION_RAISE(self->parent, e);
}
static struct exception_handler lshd_exception_handler
= STATIC_EXCEPTION_HANDLER(do_exc_lshd_handler, &default_exception_handler);
/* Invoked when starting the ssh-connection service */ /* Invoked when starting the ssh-connection service */
/* GABA: /* GABA:
...@@ -909,7 +925,7 @@ make_lshd_connection_service(struct lshd_options *options) ...@@ -909,7 +925,7 @@ make_lshd_connection_service(struct lshd_options *options)
(services (connection_handshake (services (connection_handshake
handshake handshake
kexinit kexinit
keys keys
(logger lv)))))) (logger lv))))))
*/ */
...@@ -975,7 +991,7 @@ make_lshd_listen_callback(struct lshd_options *options, ...@@ -975,7 +991,7 @@ make_lshd_listen_callback(struct lshd_options *options,
-1)))); -1))));
/* There should be no exceptions raised on the fd:s we listen on */ /* There should be no exceptions raised on the fd:s we listen on */
return make_listen_callback(server_callback, &default_exception_handler); return make_listen_callback(server_callback, &lshd_exception_handler);
} }
} }
...@@ -1053,7 +1069,7 @@ main(int argc, char **argv) ...@@ -1053,7 +1069,7 @@ main(int argc, char **argv)
make_lshd_listen_callback make_lshd_listen_callback
(options, keys, (options, keys,
make_lshd_connection_service(options)), make_lshd_connection_service(options)),
&default_exception_handler); &lshd_exception_handler);
if (!fds) if (!fds)
{ {
werror("Could not bind any address.\n"); werror("Could not bind any address.\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment