summaryrefslogtreecommitdiff
path: root/auth-rhosts.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2019-10-09 22:59:48 +0100
committerColin Watson <cjwatson@debian.org>2019-10-09 23:39:39 +0100
commit767ee84d3465b6d244a9108de5c167a9ab866df9 (patch)
tree69b14ef6a62d7f133298a21d2ad6046f130b7801 /auth-rhosts.c
parentddeaf9ee7d5c6612b88f1c4a83fc6fbccb93bf60 (diff)
parentefef12825b9582c1710da3b7e50135870963d4f4 (diff)
New upstream release (8.1p1)
Diffstat (limited to 'auth-rhosts.c')
-rw-r--r--auth-rhosts.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/auth-rhosts.c b/auth-rhosts.c
index 546aa0495..587f53721 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth-rhosts.c,v 1.49 2018/07/09 21:35:50 markus Exp $ */ 1/* $OpenBSD: auth-rhosts.c,v 1.51 2019/10/02 00:42:30 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -38,7 +38,6 @@
38#include "sshkey.h" 38#include "sshkey.h"
39#include "servconf.h" 39#include "servconf.h"
40#include "canohost.h" 40#include "canohost.h"
41#include "sshkey.h"
42#include "hostfile.h" 41#include "hostfile.h"
43#include "auth.h" 42#include "auth.h"
44 43
@@ -222,8 +221,8 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname,
222 * are no system-wide files. 221 * are no system-wide files.
223 */ 222 */
224 if (!rhosts_files[rhosts_file_index] && 223 if (!rhosts_files[rhosts_file_index] &&
225 stat(_PATH_RHOSTS_EQUIV, &st) < 0 && 224 stat(_PATH_RHOSTS_EQUIV, &st) == -1 &&
226 stat(_PATH_SSH_HOSTS_EQUIV, &st) < 0) { 225 stat(_PATH_SSH_HOSTS_EQUIV, &st) == -1) {
227 debug3("%s: no hosts access files exist", __func__); 226 debug3("%s: no hosts access files exist", __func__);
228 return 0; 227 return 0;
229 } 228 }
@@ -253,7 +252,7 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname,
253 * Check that the home directory is owned by root or the user, and is 252 * Check that the home directory is owned by root or the user, and is
254 * not group or world writable. 253 * not group or world writable.
255 */ 254 */
256 if (stat(pw->pw_dir, &st) < 0) { 255 if (stat(pw->pw_dir, &st) == -1) {
257 logit("Rhosts authentication refused for %.100s: " 256 logit("Rhosts authentication refused for %.100s: "
258 "no home directory %.200s", pw->pw_name, pw->pw_dir); 257 "no home directory %.200s", pw->pw_name, pw->pw_dir);
259 auth_debug_add("Rhosts authentication refused for %.100s: " 258 auth_debug_add("Rhosts authentication refused for %.100s: "
@@ -277,7 +276,7 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname,
277 /* Check users .rhosts or .shosts. */ 276 /* Check users .rhosts or .shosts. */
278 snprintf(buf, sizeof buf, "%.500s/%.100s", 277 snprintf(buf, sizeof buf, "%.500s/%.100s",
279 pw->pw_dir, rhosts_files[rhosts_file_index]); 278 pw->pw_dir, rhosts_files[rhosts_file_index]);
280 if (stat(buf, &st) < 0) 279 if (stat(buf, &st) == -1)
281 continue; 280 continue;
282 281
283 /* 282 /*