- deraadt@cvs.openbsd.org 2001/01/25 8:06:33
[ssh-agent.c] call _exit() in signal handler
This commit is contained in:
parent
27eebe6c1b
commit
77808aba58
|
@ -1,6 +1,10 @@
|
|||
20010126
|
||||
- (bal) SSH_PROGRAM vs _PATH_SSH_PROGRAM fix pointed out by Roumen
|
||||
Petrov <roumen.petrov@skalasoft.com>
|
||||
- (bal) OpenBSD Sync
|
||||
- deraadt@cvs.openbsd.org 2001/01/25 8:06:33
|
||||
[ssh-agent.c]
|
||||
call _exit() in signal handler
|
||||
|
||||
20010125
|
||||
- (djm) Sync bsd-* support files:
|
||||
|
|
21
ssh-agent.c
21
ssh-agent.c
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ssh-agent.c,v 1.47 2001/01/21 19:05:56 markus Exp $ */
|
||||
/* $OpenBSD: ssh-agent.c,v 1.48 2001/01/25 08:06:33 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: ssh-agent.c,v 1.47 2001/01/21 19:05:56 markus Exp $");
|
||||
RCSID("$OpenBSD: ssh-agent.c,v 1.48 2001/01/25 08:06:33 deraadt Exp $");
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/md5.h>
|
||||
|
@ -683,8 +683,10 @@ check_parent_exists(int sig)
|
|||
void
|
||||
cleanup_socket(void)
|
||||
{
|
||||
unlink(socket_name);
|
||||
rmdir(socket_dir);
|
||||
if (socket_name[0])
|
||||
unlink(socket_name);
|
||||
if (socket_dir[0])
|
||||
rmdir(socket_dir);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -694,6 +696,13 @@ cleanup_exit(int i)
|
|||
exit(i);
|
||||
}
|
||||
|
||||
void
|
||||
cleanup_handler(int sig)
|
||||
{
|
||||
cleanup_socket();
|
||||
_exit(2);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
@ -866,8 +875,8 @@ main(int ac, char **av)
|
|||
idtab_init();
|
||||
signal(SIGINT, SIG_IGN);
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
signal(SIGHUP, cleanup_exit);
|
||||
signal(SIGTERM, cleanup_exit);
|
||||
signal(SIGHUP, cleanup_handler);
|
||||
signal(SIGTERM, cleanup_handler);
|
||||
while (1) {
|
||||
prepare_select(&readsetp, &writesetp, &max_fd);
|
||||
if (select(max_fd + 1, readsetp, writesetp, NULL, NULL) < 0) {
|
||||
|
|
Loading…
Reference in New Issue