summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth.c5
-rw-r--r--servconf.c10
-rw-r--r--servconf.h4
-rw-r--r--sshd.c6
4 files changed, 11 insertions, 14 deletions
diff --git a/auth.c b/auth.c
index 94f43a6c2..d82b40683 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.c,v 1.136 2019/01/19 21:31:32 djm Exp $ */ 1/* $OpenBSD: auth.c,v 1.137 2019/01/19 21:37:48 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -572,8 +572,9 @@ getpwnamallow(const char *user)
572#endif 572#endif
573#endif 573#endif
574 struct passwd *pw; 574 struct passwd *pw;
575 struct connection_info *ci = get_connection_info(1, options.use_dns); 575 struct connection_info *ci;
576 576
577 ci = get_connection_info(ssh, 1, options.use_dns);
577 ci->user = user; 578 ci->user = user;
578 parse_server_match_config(&options, ci); 579 parse_server_match_config(&options, ci);
579 log_change_level(options.log_level); 580 log_change_level(options.log_level);
diff --git a/servconf.c b/servconf.c
index 0ec095bd0..86c631bb0 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.345 2019/01/19 21:31:32 djm Exp $ */ 2/* $OpenBSD: servconf.c,v 1.346 2019/01/19 21:37:48 djm Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -65,9 +65,6 @@
65#include "myproposal.h" 65#include "myproposal.h"
66#include "digest.h" 66#include "digest.h"
67 67
68#include "opacket.h" /* XXX */
69extern struct ssh *active_state; /* XXX */
70
71static void add_listen_addr(ServerOptions *, const char *, 68static void add_listen_addr(ServerOptions *, const char *,
72 const char *, int); 69 const char *, int);
73static void add_one_listen_addr(ServerOptions *, const char *, 70static void add_one_listen_addr(ServerOptions *, const char *,
@@ -926,12 +923,11 @@ process_permitopen(struct ssh *ssh, ServerOptions *options)
926} 923}
927 924
928struct connection_info * 925struct connection_info *
929get_connection_info(int populate, int use_dns) 926get_connection_info(struct ssh *ssh, int populate, int use_dns)
930{ 927{
931 struct ssh *ssh = active_state; /* XXX */
932 static struct connection_info ci; 928 static struct connection_info ci;
933 929
934 if (!populate) 930 if (ssh == NULL || !populate)
935 return &ci; 931 return &ci;
936 ci.host = auth_get_canonical_hostname(ssh, use_dns); 932 ci.host = auth_get_canonical_hostname(ssh, use_dns);
937 ci.address = ssh_remote_ipaddr(ssh); 933 ci.address = ssh_remote_ipaddr(ssh);
diff --git a/servconf.h b/servconf.h
index 548ad5a0c..54e0a8d8d 100644
--- a/servconf.h
+++ b/servconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.h,v 1.138 2018/11/19 04:12:32 djm Exp $ */ 1/* $OpenBSD: servconf.h,v 1.139 2019/01/19 21:37:48 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -258,7 +258,7 @@ struct connection_info {
258 M_CP_STRARRAYOPT(permitted_listens, num_permitted_listens); \ 258 M_CP_STRARRAYOPT(permitted_listens, num_permitted_listens); \
259 } while (0) 259 } while (0)
260 260
261struct connection_info *get_connection_info(int, int); 261struct connection_info *get_connection_info(struct ssh *, int, int);
262void initialize_server_options(ServerOptions *); 262void initialize_server_options(ServerOptions *);
263void fill_default_server_options(ServerOptions *); 263void fill_default_server_options(ServerOptions *);
264int process_server_config_line(ServerOptions *, char *, const char *, int, 264int process_server_config_line(ServerOptions *, char *, const char *, int,
diff --git a/sshd.c b/sshd.c
index ad8c152a5..64f27a7bb 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.522 2019/01/19 21:31:32 djm Exp $ */ 1/* $OpenBSD: sshd.c,v 1.523 2019/01/19 21:37:48 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1493,7 +1493,7 @@ main(int ac, char **av)
1493 test_flag = 2; 1493 test_flag = 2;
1494 break; 1494 break;
1495 case 'C': 1495 case 'C':
1496 connection_info = get_connection_info(0, 0); 1496 connection_info = get_connection_info(ssh, 0, 0);
1497 if (parse_server_match_testspec(connection_info, 1497 if (parse_server_match_testspec(connection_info,
1498 optarg) == -1) 1498 optarg) == -1)
1499 exit(1); 1499 exit(1);
@@ -1776,7 +1776,7 @@ main(int ac, char **av)
1776 * use a blank one that will cause no predicate to match. 1776 * use a blank one that will cause no predicate to match.
1777 */ 1777 */
1778 if (connection_info == NULL) 1778 if (connection_info == NULL)
1779 connection_info = get_connection_info(0, 0); 1779 connection_info = get_connection_info(ssh, 0, 0);
1780 parse_server_match_config(&options, connection_info); 1780 parse_server_match_config(&options, connection_info);
1781 dump_config(&options); 1781 dump_config(&options);
1782 } 1782 }