summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-02-19 22:25:37 +1100
committerDarren Tucker <dtucker@zip.com.au>2007-02-19 22:25:37 +1100
commit1629c07c0725fd5cc533c9664b8e8add27a81c69 (patch)
tree2954f5aba367319421509ea0100b76ab710260b5 /monitor_wrap.c
parent591322ae3897bef0b19236ec0c2a6053e8466e71 (diff)
- dtucker@cvs.openbsd.org 2007/02/19 10:45:58
[monitor_wrap.c servconf.c servconf.h monitor.c sshd_config.5] Teach Match how handle config directives that are used before authentication. This allows configurations such as permitting password authentication from the local net only while requiring pubkey from offsite. ok djm@, man page bits ok jmc@
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 3865539df..27cc1c5f1 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.54 2006/08/12 20:46:46 miod Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.55 2007/02/19 10:45:58 dtucker Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -73,6 +73,7 @@
73 73
74#include "channels.h" 74#include "channels.h"
75#include "session.h" 75#include "session.h"
76#include "servconf.h"
76 77
77/* Imports */ 78/* Imports */
78extern int compat20; 79extern int compat20;
@@ -207,7 +208,8 @@ mm_getpwnamallow(const char *username)
207{ 208{
208 Buffer m; 209 Buffer m;
209 struct passwd *pw; 210 struct passwd *pw;
210 u_int pwlen; 211 u_int len;
212 ServerOptions *newopts;
211 213
212 debug3("%s entering", __func__); 214 debug3("%s entering", __func__);
213 215
@@ -223,8 +225,8 @@ mm_getpwnamallow(const char *username)
223 buffer_free(&m); 225 buffer_free(&m);
224 return (NULL); 226 return (NULL);
225 } 227 }
226 pw = buffer_get_string(&m, &pwlen); 228 pw = buffer_get_string(&m, &len);
227 if (pwlen != sizeof(struct passwd)) 229 if (len != sizeof(struct passwd))
228 fatal("%s: struct passwd size mismatch", __func__); 230 fatal("%s: struct passwd size mismatch", __func__);
229 pw->pw_name = buffer_get_string(&m, NULL); 231 pw->pw_name = buffer_get_string(&m, NULL);
230 pw->pw_passwd = buffer_get_string(&m, NULL); 232 pw->pw_passwd = buffer_get_string(&m, NULL);
@@ -234,6 +236,16 @@ mm_getpwnamallow(const char *username)
234#endif 236#endif
235 pw->pw_dir = buffer_get_string(&m, NULL); 237 pw->pw_dir = buffer_get_string(&m, NULL);
236 pw->pw_shell = buffer_get_string(&m, NULL); 238 pw->pw_shell = buffer_get_string(&m, NULL);
239
240 /* copy options block as a Match directive may have changed some */
241 newopts = buffer_get_string(&m, &len);
242 if (len != sizeof(*newopts))
243 fatal("%s: option block size mismatch", __func__);
244 if (newopts->banner != NULL)
245 newopts->banner = buffer_get_string(&m, NULL);
246 copy_set_server_options(&options, newopts, 1);
247 xfree(newopts);
248
237 buffer_free(&m); 249 buffer_free(&m);
238 250
239 return (pw); 251 return (pw);