diff options
Diffstat (limited to 'channels.c')
| -rw-r--r-- | channels.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/channels.c b/channels.c index d9f59f4666cc..da66b7b3494c 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.430 2023/03/10 03:01:51 dtucker Exp $ */ +/* $OpenBSD: channels.c,v 1.432 2023/07/04 03:59:21 dlg Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -154,7 +154,7 @@ struct permission_set { /* Used to record timeouts per channel type */ struct ssh_channel_timeout { char *type_pattern; - u_int timeout_secs; + int timeout_secs; }; /* Master structure for channels state */ @@ -312,11 +312,11 @@ channel_lookup(struct ssh *ssh, int id) */ void channel_add_timeout(struct ssh *ssh, const char *type_pattern, - u_int timeout_secs) + int timeout_secs) { struct ssh_channels *sc = ssh->chanctxt; - debug2_f("channel type \"%s\" timeout %u seconds", + debug2_f("channel type \"%s\" timeout %d seconds", type_pattern, timeout_secs); sc->timeouts = xrecallocarray(sc->timeouts, sc->ntimeouts, sc->ntimeouts + 1, sizeof(*sc->timeouts)); @@ -340,7 +340,7 @@ channel_clear_timeouts(struct ssh *ssh) sc->ntimeouts = 0; } -static u_int +static int lookup_timeout(struct ssh *ssh, const char *type) { struct ssh_channels *sc = ssh->chanctxt; @@ -1634,7 +1634,7 @@ channel_decode_socks5(Channel *c, struct sshbuf *input, struct sshbuf *output) Channel * channel_connect_stdio_fwd(struct ssh *ssh, - const char *host_to_connect, u_short port_to_connect, + const char *host_to_connect, int port_to_connect, int in, int out, int nonblock) { Channel *c; @@ -1651,7 +1651,8 @@ channel_connect_stdio_fwd(struct ssh *ssh, c->force_drain = 1; channel_register_fds(ssh, c, in, out, -1, 0, 1, 0); - port_open_helper(ssh, c, "direct-tcpip"); + port_open_helper(ssh, c, port_to_connect == PORT_STREAMLOCAL ? + "direct-streamlocal@openssh.com" : "direct-tcpip"); return c; } @@ -5045,8 +5046,10 @@ connect_local_xsocket_path(const char *pathname) struct sockaddr_un addr; sock = socket(AF_UNIX, SOCK_STREAM, 0); - if (sock == -1) + if (sock == -1) { error("socket: %.100s", strerror(errno)); + return -1; + } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strlcpy(addr.sun_path, pathname, sizeof addr.sun_path); |
