| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: sshd.c,v 1.48 2023/07/26 17:58:16 christos Exp $ */ | | 1 | /* $NetBSD: sshd.c,v 1.49 2023/07/28 09:47:37 rin Exp $ */ |
2 | /* $OpenBSD: sshd.c,v 1.600 2023/03/08 04:43:12 guenther Exp $ */ | | 2 | /* $OpenBSD: sshd.c,v 1.600 2023/03/08 04:43:12 guenther Exp $ */ |
3 | /* | | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
5 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | | 5 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
6 | * All rights reserved | | 6 | * All rights reserved |
7 | * This program is the ssh daemon. It listens for connections from clients, | | 7 | * This program is the ssh daemon. It listens for connections from clients, |
8 | * and performs authentication, executes use commands or shell, and forwards | | 8 | * and performs authentication, executes use commands or shell, and forwards |
9 | * information to/from the application to the user client over an encrypted | | 9 | * information to/from the application to the user client over an encrypted |
10 | * connection. This can also handle forwarding of X11, TCP/IP, and | | 10 | * connection. This can also handle forwarding of X11, TCP/IP, and |
11 | * authentication agent connections. | | 11 | * authentication agent connections. |
12 | * | | 12 | * |
13 | * As far as I am concerned, the code I have written for this software | | 13 | * As far as I am concerned, the code I have written for this software |
14 | * can be used freely for any purpose. Any derived versions of this | | 14 | * can be used freely for any purpose. Any derived versions of this |
| @@ -34,27 +34,27 @@ | | | @@ -34,27 +34,27 @@ |
34 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | | 34 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
35 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 35 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
36 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 36 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
37 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 37 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
38 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 38 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
39 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 39 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
40 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 40 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
41 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 41 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
43 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 43 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
44 | */ | | 44 | */ |
45 | | | 45 | |
46 | #include "includes.h" | | 46 | #include "includes.h" |
47 | __RCSID("$NetBSD: sshd.c,v 1.48 2023/07/26 17:58:16 christos Exp $"); | | 47 | __RCSID("$NetBSD: sshd.c,v 1.49 2023/07/28 09:47:37 rin Exp $"); |
48 | #include <sys/types.h> | | 48 | #include <sys/types.h> |
49 | #include <sys/param.h> | | 49 | #include <sys/param.h> |
50 | #include <sys/ioctl.h> | | 50 | #include <sys/ioctl.h> |
51 | #include <sys/wait.h> | | 51 | #include <sys/wait.h> |
52 | #include <sys/tree.h> | | 52 | #include <sys/tree.h> |
53 | #include <sys/stat.h> | | 53 | #include <sys/stat.h> |
54 | #include <sys/socket.h> | | 54 | #include <sys/socket.h> |
55 | #include <sys/time.h> | | 55 | #include <sys/time.h> |
56 | #include <sys/queue.h> | | 56 | #include <sys/queue.h> |
57 | | | 57 | |
58 | #include <errno.h> | | 58 | #include <errno.h> |
59 | #include <fcntl.h> | | 59 | #include <fcntl.h> |
60 | #include <netdb.h> | | 60 | #include <netdb.h> |
| @@ -1474,27 +1474,27 @@ accumulate_host_timing_secret(struct ssh | | | @@ -1474,27 +1474,27 @@ accumulate_host_timing_secret(struct ssh |
1474 | } | | 1474 | } |
1475 | | | 1475 | |
1476 | static char * | | 1476 | static char * |
1477 | prepare_proctitle(int ac, char **av) | | 1477 | prepare_proctitle(int ac, char **av) |
1478 | { | | 1478 | { |
1479 | char *ret = NULL; | | 1479 | char *ret = NULL; |
1480 | int i; | | 1480 | int i; |
1481 | | | 1481 | |
1482 | for (i = 0; i < ac; i++) | | 1482 | for (i = 0; i < ac; i++) |
1483 | xextendf(&ret, " ", "%s", av[i]); | | 1483 | xextendf(&ret, " ", "%s", av[i]); |
1484 | return ret; | | 1484 | return ret; |
1485 | } | | 1485 | } |
1486 | | | 1486 | |
1487 | static void | | 1487 | __dead static void |
1488 | print_config(struct ssh *ssh, struct connection_info *connection_info) | | 1488 | print_config(struct ssh *ssh, struct connection_info *connection_info) |
1489 | { | | 1489 | { |
1490 | /* | | 1490 | /* |
1491 | * If no connection info was provided by -C then use | | 1491 | * If no connection info was provided by -C then use |
1492 | * use a blank one that will cause no predicate to match. | | 1492 | * use a blank one that will cause no predicate to match. |
1493 | */ | | 1493 | */ |
1494 | if (connection_info == NULL) | | 1494 | if (connection_info == NULL) |
1495 | connection_info = get_connection_info(ssh, 0, 0); | | 1495 | connection_info = get_connection_info(ssh, 0, 0); |
1496 | connection_info->test = 1; | | 1496 | connection_info->test = 1; |
1497 | parse_server_match_config(&options, &includes, connection_info); | | 1497 | parse_server_match_config(&options, &includes, connection_info); |
1498 | dump_config(&options); | | 1498 | dump_config(&options); |
1499 | exit(0); | | 1499 | exit(0); |
1500 | } | | 1500 | } |