-/* $OpenBSD: monitor_wrap.c,v 1.48 2006/07/22 20:48:23 stevesk Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.56 2007/06/05 06:52:37 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
#include "includes.h"
#include <sys/types.h>
-
-#include <openssl/bn.h>
-#include <openssl/dh.h>
+#include <sys/uio.h>
#include <errno.h>
#include <pwd.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
#include <string.h>
+#include <unistd.h>
+
+#include <openssl/bn.h>
+#include <openssl/dh.h>
+#include "xmalloc.h"
#include "ssh.h"
#include "dh.h"
+#include "buffer.h"
+#include "key.h"
+#include "cipher.h"
#include "kex.h"
+#include "hostfile.h"
#include "auth.h"
#include "auth-options.h"
-#include "buffer.h"
-#include "bufaux.h"
#include "packet.h"
#include "mac.h"
#include "log.h"
#include "zlib.h"
#endif
#include "monitor.h"
+#ifdef GSSAPI
+#include "ssh-gss.h"
+#endif
#include "monitor_wrap.h"
-#include "xmalloc.h"
#include "atomicio.h"
#include "monitor_fdpass.h"
#include "misc.h"
#include "servconf.h"
-#include "auth.h"
#include "channels.h"
#include "session.h"
-
-#ifdef GSSAPI
-#include "ssh-gss.h"
-#endif
+#include "servconf.h"
/* Imports */
extern int compat20;
{
Buffer m;
struct passwd *pw;
- u_int pwlen;
+ u_int len;
+ ServerOptions *newopts;
debug3("%s entering", __func__);
buffer_free(&m);
return (NULL);
}
- pw = buffer_get_string(&m, &pwlen);
- if (pwlen != sizeof(struct passwd))
+ pw = buffer_get_string(&m, &len);
+ if (len != sizeof(struct passwd))
fatal("%s: struct passwd size mismatch", __func__);
pw->pw_name = buffer_get_string(&m, NULL);
pw->pw_passwd = buffer_get_string(&m, NULL);
#endif
pw->pw_dir = buffer_get_string(&m, NULL);
pw->pw_shell = buffer_get_string(&m, NULL);
+
+ /* copy options block as a Match directive may have changed some */
+ newopts = buffer_get_string(&m, &len);
+ if (len != sizeof(*newopts))
+ fatal("%s: option block size mismatch", __func__);
+ if (newopts->banner != NULL)
+ newopts->banner = buffer_get_string(&m, NULL);
+ copy_set_server_options(&options, newopts, 1);
+ xfree(newopts);
+
buffer_free(&m);
return (pw);
/* Mac structure */
mac->name = buffer_get_string(&b, NULL);
- if (mac->name == NULL || mac_init(mac, mac->name) == -1)
+ if (mac->name == NULL || mac_setup(mac, mac->name) == -1)
fatal("%s: can not init mac %s", __func__, mac->name);
mac->enabled = buffer_get_int(&b);
mac->key = buffer_get_string(&b, &len);
u_int *numprompts, char ***prompts, u_int **echo_on)
{
Buffer m;
- int len;
u_int success;
- char *p, *challenge;
+ char *challenge;
debug3("%s: entering", __func__);