summaryrefslogtreecommitdiff
path: root/auth-rhosts.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth-rhosts.c')
-rw-r--r--auth-rhosts.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/auth-rhosts.c b/auth-rhosts.c
index ebf2fcbc2..7e5614cb8 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -16,12 +16,13 @@ the login based on rhosts authentication. This file also processes
16*/ 16*/
17 17
18#include "includes.h" 18#include "includes.h"
19RCSID("$Id: auth-rhosts.c,v 1.1 1999/10/27 03:42:43 damien Exp $"); 19RCSID("$Id: auth-rhosts.c,v 1.2 1999/11/12 04:19:27 damien Exp $");
20 20
21#include "packet.h" 21#include "packet.h"
22#include "ssh.h" 22#include "ssh.h"
23#include "xmalloc.h" 23#include "xmalloc.h"
24#include "uidswap.h" 24#include "uidswap.h"
25#include "servconf.h"
25 26
26/* This function processes an rhosts-style file (.rhosts, .shosts, or 27/* This function processes an rhosts-style file (.rhosts, .shosts, or
27 /etc/hosts.equiv). This returns true if authentication can be granted 28 /etc/hosts.equiv). This returns true if authentication can be granted
@@ -155,9 +156,9 @@ int check_rhosts_file(const char *filename, const char *hostname,
155 true, only /etc/hosts.equiv will be considered (.rhosts and .shosts 156 true, only /etc/hosts.equiv will be considered (.rhosts and .shosts
156 are ignored). */ 157 are ignored). */
157 158
158int auth_rhosts(struct passwd *pw, const char *client_user, 159int auth_rhosts(struct passwd *pw, const char *client_user)
159 int ignore_rhosts, int strict_modes)
160{ 160{
161 extern ServerOptions options;
161 char buf[1024]; 162 char buf[1024];
162 const char *hostname, *ipaddr; 163 const char *hostname, *ipaddr;
163 int port; 164 int port;
@@ -234,7 +235,7 @@ int auth_rhosts(struct passwd *pw, const char *client_user,
234 pw->pw_name, pw->pw_dir); 235 pw->pw_name, pw->pw_dir);
235 return 0; 236 return 0;
236 } 237 }
237 if (strict_modes && 238 if (options.strict_modes &&
238 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || 239 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
239 (st.st_mode & 022) != 0)) 240 (st.st_mode & 022) != 0))
240 { 241 {
@@ -261,7 +262,7 @@ int auth_rhosts(struct passwd *pw, const char *client_user,
261 and make sure it is not writable by anyone but the owner. This is 262 and make sure it is not writable by anyone but the owner. This is
262 to help avoid novices accidentally allowing access to their account 263 to help avoid novices accidentally allowing access to their account
263 by anyone. */ 264 by anyone. */
264 if (strict_modes && 265 if (options.strict_modes &&
265 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || 266 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
266 (st.st_mode & 022) != 0)) 267 (st.st_mode & 022) != 0))
267 { 268 {
@@ -273,7 +274,7 @@ int auth_rhosts(struct passwd *pw, const char *client_user,
273 274
274 /* Check if we have been configured to ignore .rhosts and .shosts 275 /* Check if we have been configured to ignore .rhosts and .shosts
275 files. */ 276 files. */
276 if (ignore_rhosts) 277 if (options.ignore_rhosts)
277 { 278 {
278 packet_send_debug("Server has been configured to ignore %.100s.", 279 packet_send_debug("Server has been configured to ignore %.100s.",
279 rhosts_files[rhosts_file_index]); 280 rhosts_files[rhosts_file_index]);