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