diff options
author | Damien Miller <djm@mindrot.org> | 2001-10-10 15:07:44 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-10-10 15:07:44 +1000 |
commit | 139d4cd9087bb3eaf751406016bc2223d7d0d7b1 (patch) | |
tree | 618f354b6eaa84a7a39d4a407f129adfb1711e7a | |
parent | 7ea6f204b67039e09c79dfb3049a88806e5d1ea3 (diff) |
- markus@cvs.openbsd.org 2001/10/09 10:12:08
[session.c]
chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | session.c | 22 | ||||
-rw-r--r-- | ssh-keyscan.c | 6 | ||||
-rw-r--r-- | ssh.c | 4 | ||||
-rw-r--r-- | sshconnect.c | 12 | ||||
-rw-r--r-- | sshconnect.h | 4 |
6 files changed, 27 insertions, 29 deletions
@@ -31,6 +31,12 @@ | |||
31 | - markus@cvs.openbsd.org 2001/10/08 16:15:47 | 31 | - markus@cvs.openbsd.org 2001/10/08 16:15:47 |
32 | [sshconnect.c] | 32 | [sshconnect.c] |
33 | use correct family for -b option | 33 | use correct family for -b option |
34 | - markus@cvs.openbsd.org 2001/10/08 19:05:05 | ||
35 | [ssh.c sshconnect.c sshconnect.h ssh-keyscan.c] | ||
36 | some more IPv4or6 cleanup | ||
37 | - markus@cvs.openbsd.org 2001/10/09 10:12:08 | ||
38 | [session.c] | ||
39 | chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu | ||
34 | 40 | ||
35 | 20011007 | 41 | 20011007 |
36 | - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys. | 42 | - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys. |
@@ -6676,4 +6682,4 @@ | |||
6676 | - Wrote replacements for strlcpy and mkdtemp | 6682 | - Wrote replacements for strlcpy and mkdtemp |
6677 | - Released 1.0pre1 | 6683 | - Released 1.0pre1 |
6678 | 6684 | ||
6679 | $Id: ChangeLog,v 1.1594 2001/10/10 05:04:41 djm Exp $ | 6685 | $Id: ChangeLog,v 1.1595 2001/10/10 05:07:44 djm Exp $ |
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.103 2001/10/06 00:36:42 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.104 2001/10/09 10:12:08 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -1342,16 +1342,6 @@ do_child(Session *s, const char *command) | |||
1342 | for (i = 3; i < 64; i++) | 1342 | for (i = 3; i < 64; i++) |
1343 | close(i); | 1343 | close(i); |
1344 | 1344 | ||
1345 | /* Change current directory to the user\'s home directory. */ | ||
1346 | if (chdir(pw->pw_dir) < 0) { | ||
1347 | fprintf(stderr, "Could not chdir to home directory %s: %s\n", | ||
1348 | pw->pw_dir, strerror(errno)); | ||
1349 | #ifdef HAVE_LOGIN_CAP | ||
1350 | if (login_getcapbool(lc, "requirehome", 0)) | ||
1351 | exit(1); | ||
1352 | #endif | ||
1353 | } | ||
1354 | |||
1355 | /* | 1345 | /* |
1356 | * Must take new environment into use so that .ssh/rc, /etc/sshrc and | 1346 | * Must take new environment into use so that .ssh/rc, /etc/sshrc and |
1357 | * xauth are run in the proper environment. | 1347 | * xauth are run in the proper environment. |
@@ -1370,6 +1360,16 @@ do_child(Session *s, const char *command) | |||
1370 | } | 1360 | } |
1371 | #endif /* AFS */ | 1361 | #endif /* AFS */ |
1372 | 1362 | ||
1363 | /* Change current directory to the user\'s home directory. */ | ||
1364 | if (chdir(pw->pw_dir) < 0) { | ||
1365 | fprintf(stderr, "Could not chdir to home directory %s: %s\n", | ||
1366 | pw->pw_dir, strerror(errno)); | ||
1367 | #ifdef HAVE_LOGIN_CAP | ||
1368 | if (login_getcapbool(lc, "requirehome", 0)) | ||
1369 | exit(1); | ||
1370 | #endif | ||
1371 | } | ||
1372 | |||
1373 | /* | 1373 | /* |
1374 | * Run $HOME/.ssh/rc, /etc/sshrc, or xauth (whichever is found first | 1374 | * Run $HOME/.ssh/rc, /etc/sshrc, or xauth (whichever is found first |
1375 | * in this order). | 1375 | * in this order). |
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 1849c33b4..c46ce633f 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "includes.h" | 9 | #include "includes.h" |
10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.29 2001/08/30 22:22:32 markus Exp $"); | 10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.30 2001/10/08 19:05:05 markus Exp $"); |
11 | 11 | ||
12 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) | 12 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) |
13 | #include <sys/queue.h> | 13 | #include <sys/queue.h> |
@@ -36,11 +36,7 @@ RCSID("$OpenBSD: ssh-keyscan.c,v 1.29 2001/08/30 22:22:32 markus Exp $"); | |||
36 | 36 | ||
37 | /* Flag indicating whether IPv4 or IPv6. This can be set on the command line. | 37 | /* Flag indicating whether IPv4 or IPv6. This can be set on the command line. |
38 | Default value is AF_UNSPEC means both IPv4 and IPv6. */ | 38 | Default value is AF_UNSPEC means both IPv4 and IPv6. */ |
39 | #ifdef IPV4_DEFAULT | ||
40 | int IPv4or6 = AF_INET; | ||
41 | #else | ||
42 | int IPv4or6 = AF_UNSPEC; | 39 | int IPv4or6 = AF_UNSPEC; |
43 | #endif | ||
44 | 40 | ||
45 | int ssh_port = SSH_DEFAULT_PORT; | 41 | int ssh_port = SSH_DEFAULT_PORT; |
46 | 42 | ||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: ssh.c,v 1.146 2001/10/01 21:38:53 markus Exp $"); | 42 | RCSID("$OpenBSD: ssh.c,v 1.147 2001/10/08 19:05:05 markus Exp $"); |
43 | 43 | ||
44 | #include <openssl/evp.h> | 44 | #include <openssl/evp.h> |
45 | #include <openssl/err.h> | 45 | #include <openssl/err.h> |
@@ -681,7 +681,7 @@ again: | |||
681 | 681 | ||
682 | /* Open a connection to the remote host. */ | 682 | /* Open a connection to the remote host. */ |
683 | 683 | ||
684 | cerr = ssh_connect(host, &hostaddr, options.port, | 684 | cerr = ssh_connect(host, &hostaddr, options.port, IPv4or6, |
685 | options.connection_attempts, | 685 | options.connection_attempts, |
686 | original_effective_uid != 0 || !options.use_privileged_port, | 686 | original_effective_uid != 0 || !options.use_privileged_port, |
687 | pw, options.proxy_command); | 687 | pw, options.proxy_command); |
diff --git a/sshconnect.c b/sshconnect.c index 7c928539e..de6cc2204 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -13,7 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "includes.h" | 15 | #include "includes.h" |
16 | RCSID("$OpenBSD: sshconnect.c,v 1.114 2001/10/08 16:15:47 markus Exp $"); | 16 | RCSID("$OpenBSD: sshconnect.c,v 1.115 2001/10/08 19:05:05 markus Exp $"); |
17 | 17 | ||
18 | #include <openssl/bn.h> | 18 | #include <openssl/bn.h> |
19 | 19 | ||
@@ -38,9 +38,6 @@ char *server_version_string = NULL; | |||
38 | extern Options options; | 38 | extern Options options; |
39 | extern char *__progname; | 39 | extern char *__progname; |
40 | 40 | ||
41 | /* AF_UNSPEC or AF_INET or AF_INET6 */ | ||
42 | extern int IPv4or6; | ||
43 | |||
44 | #ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ | 41 | #ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ |
45 | #define INET6_ADDRSTRLEN 46 | 42 | #define INET6_ADDRSTRLEN 46 |
46 | #endif | 43 | #endif |
@@ -243,9 +240,8 @@ ssh_create_socket(struct passwd *pw, int privileged, int family) | |||
243 | */ | 240 | */ |
244 | int | 241 | int |
245 | ssh_connect(const char *host, struct sockaddr_storage * hostaddr, | 242 | ssh_connect(const char *host, struct sockaddr_storage * hostaddr, |
246 | u_short port, int connection_attempts, | 243 | u_short port, int family, int connection_attempts, |
247 | int anonymous, struct passwd *pw, | 244 | int anonymous, struct passwd *pw, const char *proxy_command) |
248 | const char *proxy_command) | ||
249 | { | 245 | { |
250 | int gaierr; | 246 | int gaierr; |
251 | int on = 1; | 247 | int on = 1; |
@@ -279,7 +275,7 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr, | |||
279 | /* No proxy command. */ | 275 | /* No proxy command. */ |
280 | 276 | ||
281 | memset(&hints, 0, sizeof(hints)); | 277 | memset(&hints, 0, sizeof(hints)); |
282 | hints.ai_family = IPv4or6; | 278 | hints.ai_family = family; |
283 | hints.ai_socktype = SOCK_STREAM; | 279 | hints.ai_socktype = SOCK_STREAM; |
284 | snprintf(strport, sizeof strport, "%d", port); | 280 | snprintf(strport, sizeof strport, "%d", port); |
285 | if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) | 281 | if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) |
diff --git a/sshconnect.h b/sshconnect.h index 27ed2b745..b475adde0 100644 --- a/sshconnect.h +++ b/sshconnect.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.h,v 1.12 2001/06/26 17:27:25 markus Exp $ */ | 1 | /* $OpenBSD: sshconnect.h,v 1.13 2001/10/08 19:05:05 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -27,7 +27,7 @@ | |||
27 | #define SSHCONNECT_H | 27 | #define SSHCONNECT_H |
28 | 28 | ||
29 | int | 29 | int |
30 | ssh_connect(const char *, struct sockaddr_storage *, u_short, int, | 30 | ssh_connect(const char *, struct sockaddr_storage *, u_short, int, int, |
31 | int, struct passwd *, const char *); | 31 | int, struct passwd *, const char *); |
32 | 32 | ||
33 | void | 33 | void |