diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | auth.c | 22 | ||||
-rw-r--r-- | auth.h | 3 | ||||
-rw-r--r-- | auth1.c | 3 | ||||
-rw-r--r-- | auth2.c | 4 | ||||
-rw-r--r-- | misc.c | 19 | ||||
-rw-r--r-- | misc.h | 4 | ||||
-rw-r--r-- | ssh.c | 16 |
8 files changed, 33 insertions, 43 deletions
@@ -31,6 +31,9 @@ | |||
31 | - markus@cvs.openbsd.org 2001/02/22 21:57:27 | 31 | - markus@cvs.openbsd.org 2001/02/22 21:57:27 |
32 | [ssh.1 sshd.8] | 32 | [ssh.1 sshd.8] |
33 | typos/grammar from matt@anzen.com | 33 | typos/grammar from matt@anzen.com |
34 | - markus@cvs.openbsd.org 2001/02/22 21:59:44 | ||
35 | [auth.c auth.h auth1.c auth2.c misc.c misc.h ssh.c] | ||
36 | use pwcopy in ssh.c, too | ||
34 | 37 | ||
35 | 20010304 | 38 | 20010304 |
36 | - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid. | 39 | - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid. |
@@ -4223,4 +4226,4 @@ | |||
4223 | - Wrote replacements for strlcpy and mkdtemp | 4226 | - Wrote replacements for strlcpy and mkdtemp |
4224 | - Released 1.0pre1 | 4227 | - Released 1.0pre1 |
4225 | 4228 | ||
4226 | $Id: ChangeLog,v 1.861 2001/03/05 05:49:29 mouring Exp $ | 4229 | $Id: ChangeLog,v 1.862 2001/03/05 05:56:40 mouring Exp $ |
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth.c,v 1.17 2001/02/12 16:16:23 markus Exp $"); | 26 | RCSID("$OpenBSD: auth.c,v 1.18 2001/02/22 21:59:43 markus Exp $"); |
27 | 27 | ||
28 | #ifdef HAVE_LOGIN_H | 28 | #ifdef HAVE_LOGIN_H |
29 | #include <login.h> | 29 | #include <login.h> |
@@ -170,26 +170,6 @@ authctxt_new(void) | |||
170 | return authctxt; | 170 | return authctxt; |
171 | } | 171 | } |
172 | 172 | ||
173 | struct passwd * | ||
174 | pwcopy(struct passwd *pw) | ||
175 | { | ||
176 | struct passwd *copy = xmalloc(sizeof(*copy)); | ||
177 | memset(copy, 0, sizeof(*copy)); | ||
178 | copy->pw_name = xstrdup(pw->pw_name); | ||
179 | copy->pw_passwd = xstrdup(pw->pw_passwd); | ||
180 | copy->pw_uid = pw->pw_uid; | ||
181 | copy->pw_gid = pw->pw_gid; | ||
182 | #ifdef HAVE_PW_CLASS_IN_PASSWD | ||
183 | copy->pw_class = xstrdup(pw->pw_class); | ||
184 | #endif | ||
185 | #ifdef HAVE_CYGWIN | ||
186 | copy->pw_gecos = xstrdup(pw->pw_gecos); | ||
187 | #endif | ||
188 | copy->pw_dir = xstrdup(pw->pw_dir); | ||
189 | copy->pw_shell = xstrdup(pw->pw_shell); | ||
190 | return copy; | ||
191 | } | ||
192 | |||
193 | void | 173 | void |
194 | auth_log(Authctxt *authctxt, int authenticated, char *method, char *info) | 174 | auth_log(Authctxt *authctxt, int authenticated, char *method, char *info) |
195 | { | 175 | { |
@@ -21,7 +21,7 @@ | |||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | * | 23 | * |
24 | * $OpenBSD: auth.h,v 1.11 2001/02/12 16:16:23 markus Exp $ | 24 | * $OpenBSD: auth.h,v 1.12 2001/02/22 21:59:43 markus Exp $ |
25 | */ | 25 | */ |
26 | #ifndef AUTH_H | 26 | #ifndef AUTH_H |
27 | #define AUTH_H | 27 | #define AUTH_H |
@@ -132,7 +132,6 @@ char *get_challenge(Authctxt *authctxt, char *devs); | |||
132 | int verify_response(Authctxt *authctxt, char *response); | 132 | int verify_response(Authctxt *authctxt, char *response); |
133 | 133 | ||
134 | struct passwd * auth_get_user(void); | 134 | struct passwd * auth_get_user(void); |
135 | struct passwd * pwcopy(struct passwd *pw); | ||
136 | 135 | ||
137 | #define AUTH_FAIL_MAX 6 | 136 | #define AUTH_FAIL_MAX 6 |
138 | #define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2) | 137 | #define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2) |
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "includes.h" | 12 | #include "includes.h" |
13 | RCSID("$OpenBSD: auth1.c,v 1.17 2001/02/13 22:49:40 markus Exp $"); | 13 | RCSID("$OpenBSD: auth1.c,v 1.18 2001/02/22 21:59:43 markus Exp $"); |
14 | 14 | ||
15 | #include "xmalloc.h" | 15 | #include "xmalloc.h" |
16 | #include "rsa.h" | 16 | #include "rsa.h" |
@@ -23,6 +23,7 @@ RCSID("$OpenBSD: auth1.c,v 1.17 2001/02/13 22:49:40 markus Exp $"); | |||
23 | #include "compat.h" | 23 | #include "compat.h" |
24 | #include "auth.h" | 24 | #include "auth.h" |
25 | #include "session.h" | 25 | #include "session.h" |
26 | #include "misc.h" | ||
26 | 27 | ||
27 | /* import */ | 28 | /* import */ |
28 | extern ServerOptions options; | 29 | extern ServerOptions options; |
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2.c,v 1.42 2001/02/13 22:49:40 markus Exp $"); | 26 | RCSID("$OpenBSD: auth2.c,v 1.43 2001/02/22 21:59:44 markus Exp $"); |
27 | 27 | ||
28 | #include <openssl/evp.h> | 28 | #include <openssl/evp.h> |
29 | 29 | ||
@@ -47,6 +47,7 @@ RCSID("$OpenBSD: auth2.c,v 1.42 2001/02/13 22:49:40 markus Exp $"); | |||
47 | #include "pathnames.h" | 47 | #include "pathnames.h" |
48 | #include "uidswap.h" | 48 | #include "uidswap.h" |
49 | #include "auth-options.h" | 49 | #include "auth-options.h" |
50 | #include "misc.h" | ||
50 | 51 | ||
51 | /* import */ | 52 | /* import */ |
52 | extern ServerOptions options; | 53 | extern ServerOptions options; |
@@ -75,7 +76,6 @@ void protocol_error(int type, int plen, void *ctxt); | |||
75 | 76 | ||
76 | /* helper */ | 77 | /* helper */ |
77 | Authmethod *authmethod_lookup(const char *name); | 78 | Authmethod *authmethod_lookup(const char *name); |
78 | struct passwd *pwcopy(struct passwd *pw); | ||
79 | int user_key_allowed(struct passwd *pw, Key *key); | 79 | int user_key_allowed(struct passwd *pw, Key *key); |
80 | char *authmethods_get(void); | 80 | char *authmethods_get(void); |
81 | 81 | ||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: misc.c,v 1.1 2001/01/21 19:05:52 markus Exp $ */ | 1 | /* $OpenBSD: misc.c,v 1.2 2001/02/22 21:59:44 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: misc.c,v 1.1 2001/01/21 19:05:52 markus Exp $"); | 28 | RCSID("$OpenBSD: misc.c,v 1.2 2001/02/22 21:59:44 markus Exp $"); |
29 | 29 | ||
30 | #include "misc.h" | 30 | #include "misc.h" |
31 | #include "log.h" | 31 | #include "log.h" |
@@ -96,6 +96,21 @@ strdelim(char **s) | |||
96 | return (old); | 96 | return (old); |
97 | } | 97 | } |
98 | 98 | ||
99 | struct passwd * | ||
100 | pwcopy(struct passwd *pw) | ||
101 | { | ||
102 | struct passwd *copy = xmalloc(sizeof(*copy)); | ||
103 | memset(copy, 0, sizeof(*copy)); | ||
104 | copy->pw_name = xstrdup(pw->pw_name); | ||
105 | copy->pw_passwd = xstrdup(pw->pw_passwd); | ||
106 | copy->pw_uid = pw->pw_uid; | ||
107 | copy->pw_gid = pw->pw_gid; | ||
108 | copy->pw_class = xstrdup(pw->pw_class); | ||
109 | copy->pw_dir = xstrdup(pw->pw_dir); | ||
110 | copy->pw_shell = xstrdup(pw->pw_shell); | ||
111 | return copy; | ||
112 | } | ||
113 | |||
99 | mysig_t | 114 | mysig_t |
100 | mysignal(int sig, mysig_t act) | 115 | mysignal(int sig, mysig_t act) |
101 | { | 116 | { |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: misc.h,v 1.2 2001/01/29 01:58:17 niklas Exp $ */ | 1 | /* $OpenBSD: misc.h,v 1.3 2001/02/22 21:59:44 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -20,6 +20,8 @@ char *strdelim(char **s); | |||
20 | /* set filedescriptor to non-blocking */ | 20 | /* set filedescriptor to non-blocking */ |
21 | void set_nonblock(int fd); | 21 | void set_nonblock(int fd); |
22 | 22 | ||
23 | struct passwd * pwcopy(struct passwd *pw); | ||
24 | |||
23 | /* wrapper for signal interface */ | 25 | /* wrapper for signal interface */ |
24 | typedef void (*mysig_t)(int); | 26 | typedef void (*mysig_t)(int); |
25 | mysig_t mysignal(int sig, mysig_t act); | 27 | mysig_t mysignal(int sig, mysig_t act); |
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: ssh.c,v 1.97 2001/02/21 21:14:04 stevesk Exp $"); | 42 | RCSID("$OpenBSD: ssh.c,v 1.98 2001/02/22 21:59:44 markus Exp $"); |
43 | 43 | ||
44 | #include <openssl/evp.h> | 44 | #include <openssl/evp.h> |
45 | #include <openssl/err.h> | 45 | #include <openssl/err.h> |
@@ -245,7 +245,7 @@ main(int ac, char **av) | |||
245 | u_short fwd_port, fwd_host_port; | 245 | u_short fwd_port, fwd_host_port; |
246 | char *optarg, *cp, buf[256]; | 246 | char *optarg, *cp, buf[256]; |
247 | struct stat st; | 247 | struct stat st; |
248 | struct passwd *pw, pwcopy; | 248 | struct passwd *pw; |
249 | int dummy; | 249 | int dummy; |
250 | uid_t original_effective_uid; | 250 | uid_t original_effective_uid; |
251 | 251 | ||
@@ -555,17 +555,7 @@ main(int ac, char **av) | |||
555 | exit(1); | 555 | exit(1); |
556 | } | 556 | } |
557 | /* Take a copy of the returned structure. */ | 557 | /* Take a copy of the returned structure. */ |
558 | memset(&pwcopy, 0, sizeof(pwcopy)); | 558 | pw = pwcopy(pw); |
559 | pwcopy.pw_name = xstrdup(pw->pw_name); | ||
560 | pwcopy.pw_passwd = xstrdup(pw->pw_passwd); | ||
561 | pwcopy.pw_uid = pw->pw_uid; | ||
562 | pwcopy.pw_gid = pw->pw_gid; | ||
563 | #ifdef HAVE_PW_CLASS_IN_PASSWD | ||
564 | pwcopy.pw_class = xstrdup(pw->pw_class); | ||
565 | #endif | ||
566 | pwcopy.pw_dir = xstrdup(pw->pw_dir); | ||
567 | pwcopy.pw_shell = xstrdup(pw->pw_shell); | ||
568 | pw = &pwcopy; | ||
569 | 559 | ||
570 | /* Initialize "log" output. Since we are the client all output | 560 | /* Initialize "log" output. Since we are the client all output |
571 | actually goes to the terminal. */ | 561 | actually goes to the terminal. */ |