summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-07-22 20:40:24 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-07-22 20:40:24 +0000
commit3fdf8761078e27120b27a9801faed2e69ed998e7 (patch)
tree07f52e9bd56fd168eb9d6780c8ddf7dd4ebdcbf9
parentd01ba9898661052f1b8c154b5d457e85aec75b5f (diff)
- stevesk@cvs.openbsd.org 2001/07/18 21:40:40
[ssh-agent.c] chdir("/") from bbraun@synack.net; ok markus@
-rw-r--r--ChangeLog5
-rw-r--r--ssh-agent.c15
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 62b3a0ed9..7e6076f81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,9 @@
8 - markus@cvs.openbsd.org 2001/07/18 21:10:43 8 - markus@cvs.openbsd.org 2001/07/18 21:10:43
9 [sshpty.c] 9 [sshpty.c]
10 pr #1946, allow sshd if /dev is readonly 10 pr #1946, allow sshd if /dev is readonly
11 - stevesk@cvs.openbsd.org 2001/07/18 21:40:40
12 [ssh-agent.c]
13 chdir("/") from bbraun@synack.net; ok markus@
11 14
1220010719 1520010719
13 - (tim) [configure.in] put inet_aton back in AC_CHECK_FUNCS. 16 - (tim) [configure.in] put inet_aton back in AC_CHECK_FUNCS.
@@ -6081,4 +6084,4 @@
6081 - Wrote replacements for strlcpy and mkdtemp 6084 - Wrote replacements for strlcpy and mkdtemp
6082 - Released 1.0pre1 6085 - Released 1.0pre1
6083 6086
6084$Id: ChangeLog,v 1.1417 2001/07/22 20:36:57 mouring Exp $ 6087$Id: ChangeLog,v 1.1418 2001/07/22 20:40:24 mouring Exp $
diff --git a/ssh-agent.c b/ssh-agent.c
index ad4cbf06d..84ffe855b 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.66 2001/07/17 20:48:42 markus Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.67 2001/07/18 21:40:40 stevesk Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -36,7 +36,7 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: ssh-agent.c,v 1.66 2001/07/17 20:48:42 markus Exp $"); 39RCSID("$OpenBSD: ssh-agent.c,v 1.67 2001/07/18 21:40:40 stevesk Exp $");
40 40
41#include <openssl/evp.h> 41#include <openssl/evp.h>
42#include <openssl/md5.h> 42#include <openssl/md5.h>
@@ -987,6 +987,13 @@ main(int ac, char **av)
987 perror(av[0]); 987 perror(av[0]);
988 exit(1); 988 exit(1);
989 } 989 }
990
991 if (setsid() == -1) {
992 perror("setsid");
993 cleanup_exit(1);
994 }
995
996 (void)chdir("/");
990 close(0); 997 close(0);
991 close(1); 998 close(1);
992 close(2); 999 close(2);
@@ -999,10 +1006,6 @@ main(int ac, char **av)
999 cleanup_exit(1); 1006 cleanup_exit(1);
1000 } 1007 }
1001#endif 1008#endif
1002 if (setsid() == -1) {
1003 perror("setsid");
1004 cleanup_exit(1);
1005 }
1006 1009
1007skip: 1010skip:
1008 if (atexit(cleanup_socket) < 0) { 1011 if (atexit(cleanup_socket) < 0) {