=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth.c,v retrieving revision 1.62.2.1 retrieving revision 1.63 diff -u -r1.62.2.1 -r1.63 --- src/usr.bin/ssh/auth.c 2006/09/30 04:06:50 1.62.2.1 +++ src/usr.bin/ssh/auth.c 2006/03/19 18:51:18 1.63 @@ -1,4 +1,3 @@ -/* $OpenBSD: auth.c,v 1.62.2.1 2006/09/30 04:06:50 brad Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -23,40 +22,31 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "includes.h" + #include #include -#include -#include #include #include -#include -#include -#include -#include #include "xmalloc.h" #include "match.h" #include "groupaccess.h" #include "log.h" -#include "buffer.h" #include "servconf.h" -#include "key.h" -#include "hostfile.h" #include "auth.h" #include "auth-options.h" #include "canohost.h" +#include "buffer.h" +#include "bufaux.h" #include "uidswap.h" #include "misc.h" +#include "bufaux.h" #include "packet.h" -#ifdef GSSAPI -#include "ssh-gss.h" -#endif -#include "monitor_wrap.h" /* import */ extern ServerOptions options; -extern int use_privsep; /* Debugging messages */ Buffer auth_debug; @@ -175,9 +165,6 @@ void (*authlog) (const char *fmt,...) = verbose; char *authmsg; - if (use_privsep && !mm_is_monitor() && !authctxt->postponed) - return; - /* Raise logging level */ if (authenticated == 1 || !authctxt->valid || @@ -209,6 +196,7 @@ switch (options.permit_root_login) { case PERMIT_YES: return 1; + break; case PERMIT_NO_PASSWD: if (strcmp(method, "password") != 0) return 1; @@ -235,8 +223,7 @@ static char * expand_authorized_keys(const char *filename, struct passwd *pw) { - char *file, ret[MAXPATHLEN]; - int i; + char *file, *ret; file = percent_expand(filename, "h", pw->pw_dir, "u", pw->pw_name, (char *)NULL); @@ -248,11 +235,14 @@ if (*file == '/') return (file); - i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file); - if (i < 0 || (size_t)i >= sizeof(ret)) + ret = xmalloc(MAXPATHLEN); + if (strlcpy(ret, pw->pw_dir, MAXPATHLEN) >= MAXPATHLEN || + strlcat(ret, "/", MAXPATHLEN) >= MAXPATHLEN || + strlcat(ret, file, MAXPATHLEN) >= MAXPATHLEN) fatal("expand_authorized_keys: path too long"); + xfree(file); - return (xstrdup(ret)); + return (ret); } char * @@ -388,9 +378,6 @@ #endif #endif struct passwd *pw; - - parse_server_match_config(&options, user, - get_canonical_hostname(options.use_dns), get_remote_ipaddr()); pw = getpwnam(user); if (pw == NULL) {