[ssh-agent.c]
     chdir("/") from bbraun@synack.net; ok markus@
This commit is contained in:
Ben Lindstrom 2001-07-22 20:40:24 +00:00
parent d01ba98986
commit 3fdf876107
2 changed files with 13 additions and 7 deletions

View File

@ -8,6 +8,9 @@
- markus@cvs.openbsd.org 2001/07/18 21:10:43
[sshpty.c]
pr #1946, allow sshd if /dev is readonly
- stevesk@cvs.openbsd.org 2001/07/18 21:40:40
[ssh-agent.c]
chdir("/") from bbraun@synack.net; ok markus@
20010719
- (tim) [configure.in] put inet_aton back in AC_CHECK_FUNCS.
@ -6081,4 +6084,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
$Id: ChangeLog,v 1.1417 2001/07/22 20:36:57 mouring Exp $
$Id: ChangeLog,v 1.1418 2001/07/22 20:40:24 mouring Exp $

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh-agent.c,v 1.66 2001/07/17 20:48:42 markus Exp $ */
/* $OpenBSD: ssh-agent.c,v 1.67 2001/07/18 21:40:40 stevesk Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@ -36,7 +36,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: ssh-agent.c,v 1.66 2001/07/17 20:48:42 markus Exp $");
RCSID("$OpenBSD: ssh-agent.c,v 1.67 2001/07/18 21:40:40 stevesk Exp $");
#include <openssl/evp.h>
#include <openssl/md5.h>
@ -987,6 +987,13 @@ main(int ac, char **av)
perror(av[0]);
exit(1);
}
if (setsid() == -1) {
perror("setsid");
cleanup_exit(1);
}
(void)chdir("/");
close(0);
close(1);
close(2);
@ -999,10 +1006,6 @@ main(int ac, char **av)
cleanup_exit(1);
}
#endif
if (setsid() == -1) {
perror("setsid");
cleanup_exit(1);
}
skip:
if (atexit(cleanup_socket) < 0) {