diff options
Diffstat (limited to 'auth-rhosts.c')
-rw-r--r-- | auth-rhosts.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/auth-rhosts.c b/auth-rhosts.c index b42a64c90..afca1f7c6 100644 --- a/auth-rhosts.c +++ b/auth-rhosts.c | |||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$OpenBSD: auth-rhosts.c,v 1.31 2003/06/02 09:17:34 markus Exp $"); | 17 | RCSID("$OpenBSD: auth-rhosts.c,v 1.28 2002/05/13 21:26:49 markus Exp $"); |
18 | 18 | ||
19 | #include "packet.h" | 19 | #include "packet.h" |
20 | #include "uidswap.h" | 20 | #include "uidswap.h" |
@@ -68,8 +68,7 @@ check_rhosts_file(const char *filename, const char *hostname, | |||
68 | * This should be safe because each buffer is as big as the | 68 | * This should be safe because each buffer is as big as the |
69 | * whole string, and thus cannot be overwritten. | 69 | * whole string, and thus cannot be overwritten. |
70 | */ | 70 | */ |
71 | switch (sscanf(buf, "%1023s %1023s %1023s", hostbuf, userbuf, | 71 | switch (sscanf(buf, "%s %s %s", hostbuf, userbuf, dummy)) { |
72 | dummy)) { | ||
73 | case 0: | 72 | case 0: |
74 | auth_debug_add("Found empty line in %.100s.", filename); | 73 | auth_debug_add("Found empty line in %.100s.", filename); |
75 | continue; | 74 | continue; |
@@ -156,7 +155,7 @@ auth_rhosts(struct passwd *pw, const char *client_user) | |||
156 | { | 155 | { |
157 | const char *hostname, *ipaddr; | 156 | const char *hostname, *ipaddr; |
158 | 157 | ||
159 | hostname = get_canonical_hostname(options.use_dns); | 158 | hostname = get_canonical_hostname(options.verify_reverse_mapping); |
160 | ipaddr = get_remote_ipaddr(); | 159 | ipaddr = get_remote_ipaddr(); |
161 | return auth_rhosts2(pw, client_user, hostname, ipaddr); | 160 | return auth_rhosts2(pw, client_user, hostname, ipaddr); |
162 | } | 161 | } |
@@ -221,7 +220,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
221 | * not group or world writable. | 220 | * not group or world writable. |
222 | */ | 221 | */ |
223 | if (stat(pw->pw_dir, &st) < 0) { | 222 | if (stat(pw->pw_dir, &st) < 0) { |
224 | logit("Rhosts authentication refused for %.100s: " | 223 | log("Rhosts authentication refused for %.100s: " |
225 | "no home directory %.200s", pw->pw_name, pw->pw_dir); | 224 | "no home directory %.200s", pw->pw_name, pw->pw_dir); |
226 | auth_debug_add("Rhosts authentication refused for %.100s: " | 225 | auth_debug_add("Rhosts authentication refused for %.100s: " |
227 | "no home directory %.200s", pw->pw_name, pw->pw_dir); | 226 | "no home directory %.200s", pw->pw_name, pw->pw_dir); |
@@ -230,7 +229,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
230 | if (options.strict_modes && | 229 | if (options.strict_modes && |
231 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 230 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || |
232 | (st.st_mode & 022) != 0)) { | 231 | (st.st_mode & 022) != 0)) { |
233 | logit("Rhosts authentication refused for %.100s: " | 232 | log("Rhosts authentication refused for %.100s: " |
234 | "bad ownership or modes for home directory.", pw->pw_name); | 233 | "bad ownership or modes for home directory.", pw->pw_name); |
235 | auth_debug_add("Rhosts authentication refused for %.100s: " | 234 | auth_debug_add("Rhosts authentication refused for %.100s: " |
236 | "bad ownership or modes for home directory.", pw->pw_name); | 235 | "bad ownership or modes for home directory.", pw->pw_name); |
@@ -257,7 +256,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam | |||
257 | if (options.strict_modes && | 256 | if (options.strict_modes && |
258 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 257 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || |
259 | (st.st_mode & 022) != 0)) { | 258 | (st.st_mode & 022) != 0)) { |
260 | logit("Rhosts authentication refused for %.100s: bad modes for %.200s", | 259 | log("Rhosts authentication refused for %.100s: bad modes for %.200s", |
261 | pw->pw_name, buf); | 260 | pw->pw_name, buf); |
262 | auth_debug_add("Bad file modes for %.200s", buf); | 261 | auth_debug_add("Bad file modes for %.200s", buf); |
263 | continue; | 262 | continue; |