diff options
Diffstat (limited to 'auth-rh-rsa.c')
-rw-r--r-- | auth-rh-rsa.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c index 4e9a383a2..1392455cb 100644 --- a/auth-rh-rsa.c +++ b/auth-rh-rsa.c | |||
@@ -15,7 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | RCSID("$Id: auth-rh-rsa.c,v 1.6 1999/11/24 13:26:21 damien Exp $"); | 18 | RCSID("$Id: auth-rh-rsa.c,v 1.7 1999/11/25 00:54:57 damien Exp $"); |
19 | 19 | ||
20 | #include "packet.h" | 20 | #include "packet.h" |
21 | #include "ssh.h" | 21 | #include "ssh.h" |
@@ -23,8 +23,10 @@ RCSID("$Id: auth-rh-rsa.c,v 1.6 1999/11/24 13:26:21 damien Exp $"); | |||
23 | #include "uidswap.h" | 23 | #include "uidswap.h" |
24 | #include "servconf.h" | 24 | #include "servconf.h" |
25 | 25 | ||
26 | /* Tries to authenticate the user using the .rhosts file and the host using | 26 | /* |
27 | its host key. Returns true if authentication succeeds. */ | 27 | * Tries to authenticate the user using the .rhosts file and the host using |
28 | * its host key. Returns true if authentication succeeds. | ||
29 | */ | ||
28 | 30 | ||
29 | int | 31 | int |
30 | auth_rhosts_rsa(struct passwd *pw, const char *client_user, | 32 | auth_rhosts_rsa(struct passwd *pw, const char *client_user, |
@@ -57,8 +59,10 @@ auth_rhosts_rsa(struct passwd *pw, const char *client_user, | |||
57 | if (host_status != HOST_OK && !options.ignore_user_known_hosts) { | 59 | if (host_status != HOST_OK && !options.ignore_user_known_hosts) { |
58 | struct stat st; | 60 | struct stat st; |
59 | char *user_hostfile = tilde_expand_filename(SSH_USER_HOSTFILE, pw->pw_uid); | 61 | char *user_hostfile = tilde_expand_filename(SSH_USER_HOSTFILE, pw->pw_uid); |
60 | /* Check file permissions of SSH_USER_HOSTFILE, auth_rsa() | 62 | /* |
61 | did already check pw->pw_dir, but there is a race XXX */ | 63 | * Check file permissions of SSH_USER_HOSTFILE, auth_rsa() |
64 | * did already check pw->pw_dir, but there is a race XXX | ||
65 | */ | ||
62 | if (options.strict_modes && | 66 | if (options.strict_modes && |
63 | (stat(user_hostfile, &st) == 0) && | 67 | (stat(user_hostfile, &st) == 0) && |
64 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 68 | ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || |
@@ -91,8 +95,10 @@ auth_rhosts_rsa(struct passwd *pw, const char *client_user, | |||
91 | canonical_hostname); | 95 | canonical_hostname); |
92 | return 0; | 96 | return 0; |
93 | } | 97 | } |
94 | /* We have authenticated the user using .rhosts or /etc/hosts.equiv, and the host using RSA. | 98 | /* |
95 | We accept the authentication. */ | 99 | * We have authenticated the user using .rhosts or /etc/hosts.equiv, |
100 | * and the host using RSA. We accept the authentication. | ||
101 | */ | ||
96 | 102 | ||
97 | verbose("Rhosts with RSA host authentication accepted for %.100s, %.100s on %.700s.", | 103 | verbose("Rhosts with RSA host authentication accepted for %.100s, %.100s on %.700s.", |
98 | pw->pw_name, client_user, canonical_hostname); | 104 | pw->pw_name, client_user, canonical_hostname); |