=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth-rhosts.c,v retrieving revision 1.28 retrieving revision 1.28.4.2 diff -u -r1.28 -r1.28.4.2 --- src/usr.bin/ssh/auth-rhosts.c 2002/05/13 21:26:49 1.28 +++ src/usr.bin/ssh/auth-rhosts.c 2004/03/04 18:18:15 1.28.4.2 @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rhosts.c,v 1.28 2002/05/13 21:26:49 markus Exp $"); +RCSID("$OpenBSD: auth-rhosts.c,v 1.28.4.2 2004/03/04 18:18:15 brad Exp $"); #include "packet.h" #include "uidswap.h" @@ -68,7 +68,8 @@ * This should be safe because each buffer is as big as the * whole string, and thus cannot be overwritten. */ - switch (sscanf(buf, "%s %s %s", hostbuf, userbuf, dummy)) { + switch (sscanf(buf, "%1023s %1023s %1023s", hostbuf, userbuf, + dummy)) { case 0: auth_debug_add("Found empty line in %.100s.", filename); continue; @@ -155,7 +156,7 @@ { const char *hostname, *ipaddr; - hostname = get_canonical_hostname(options.verify_reverse_mapping); + hostname = get_canonical_hostname(options.use_dns); ipaddr = get_remote_ipaddr(); return auth_rhosts2(pw, client_user, hostname, ipaddr); } @@ -172,10 +173,6 @@ debug2("auth_rhosts2: clientuser %s hostname %s ipaddr %s", client_user, hostname, ipaddr); - /* no user given */ - if (pw == NULL) - return 0; - /* Switch to the user's uid. */ temporarily_use_uid(pw); /* @@ -220,7 +217,7 @@ * not group or world writable. */ if (stat(pw->pw_dir, &st) < 0) { - log("Rhosts authentication refused for %.100s: " + logit("Rhosts authentication refused for %.100s: " "no home directory %.200s", pw->pw_name, pw->pw_dir); auth_debug_add("Rhosts authentication refused for %.100s: " "no home directory %.200s", pw->pw_name, pw->pw_dir); @@ -229,7 +226,7 @@ if (options.strict_modes && ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || (st.st_mode & 022) != 0)) { - log("Rhosts authentication refused for %.100s: " + logit("Rhosts authentication refused for %.100s: " "bad ownership or modes for home directory.", pw->pw_name); auth_debug_add("Rhosts authentication refused for %.100s: " "bad ownership or modes for home directory.", pw->pw_name); @@ -256,7 +253,7 @@ if (options.strict_modes && ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || (st.st_mode & 022) != 0)) { - log("Rhosts authentication refused for %.100s: bad modes for %.200s", + logit("Rhosts authentication refused for %.100s: bad modes for %.200s", pw->pw_name, buf); auth_debug_add("Bad file modes for %.200s", buf); continue;