summaryrefslogtreecommitdiff
path: root/auth-options.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth-options.c')
-rw-r--r--auth-options.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/auth-options.c b/auth-options.c
index bda39df4e..a9d9a81cb 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-options.c,v 1.70 2015/12/10 17:08:40 mmcc Exp $ */ 1/* $OpenBSD: auth-options.c,v 1.71 2016/03/07 19:02:43 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
@@ -29,6 +29,7 @@
29#include "ssherr.h" 29#include "ssherr.h"
30#include "log.h" 30#include "log.h"
31#include "canohost.h" 31#include "canohost.h"
32#include "packet.h"
32#include "sshbuf.h" 33#include "sshbuf.h"
33#include "misc.h" 34#include "misc.h"
34#include "channels.h" 35#include "channels.h"
@@ -131,6 +132,7 @@ match_flag(const char *opt, int allow_negate, char **optsp, const char *msg)
131int 132int
132auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) 133auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
133{ 134{
135 struct ssh *ssh = active_state; /* XXX */
134 const char *cp; 136 const char *cp;
135 int i, r; 137 int i, r;
136 138
@@ -284,9 +286,9 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
284 } 286 }
285 cp = "from=\""; 287 cp = "from=\"";
286 if (strncasecmp(opts, cp, strlen(cp)) == 0) { 288 if (strncasecmp(opts, cp, strlen(cp)) == 0) {
287 const char *remote_ip = get_remote_ipaddr(); 289 const char *remote_ip = ssh_remote_ipaddr(ssh);
288 const char *remote_host = get_canonical_hostname( 290 const char *remote_host = auth_get_canonical_hostname(
289 options.use_dns); 291 ssh, options.use_dns);
290 char *patterns = xmalloc(strlen(opts) + 1); 292 char *patterns = xmalloc(strlen(opts) + 1);
291 293
292 opts += strlen(cp); 294 opts += strlen(cp);
@@ -471,6 +473,7 @@ parse_option_list(struct sshbuf *oblob, struct passwd *pw,
471 char **cert_forced_command, 473 char **cert_forced_command,
472 int *cert_source_address_done) 474 int *cert_source_address_done)
473{ 475{
476 struct ssh *ssh = active_state; /* XXX */
474 char *command, *allowed; 477 char *command, *allowed;
475 const char *remote_ip; 478 const char *remote_ip;
476 char *name = NULL; 479 char *name = NULL;
@@ -544,7 +547,7 @@ parse_option_list(struct sshbuf *oblob, struct passwd *pw,
544 free(allowed); 547 free(allowed);
545 goto out; 548 goto out;
546 } 549 }
547 remote_ip = get_remote_ipaddr(); 550 remote_ip = ssh_remote_ipaddr(ssh);
548 result = addr_match_cidr_list(remote_ip, 551 result = addr_match_cidr_list(remote_ip,
549 allowed); 552 allowed);
550 free(allowed); 553 free(allowed);