summaryrefslogtreecommitdiff
path: root/kerberosIV
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-02 03:11:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-12-02 03:11:23 +0000
commitabb73bdcd085a93a9cbf447d16d832bad8827925 (patch)
treee7dcf47432ae3e5750a1e382e3b1cbd1fe548f93 /kerberosIV
parentb72c81f3f8b1309ef697f16722ad9ca593b96574 (diff)
Fix 2 more signal handlers
Diffstat (limited to 'kerberosIV')
-rw-r--r--kerberosIV/src/kadmin/admin_server.c3
-rw-r--r--kerberosIV/src/kadmin/kadmin.c11
2 files changed, 10 insertions, 4 deletions
diff --git a/kerberosIV/src/kadmin/admin_server.c b/kerberosIV/src/kadmin/admin_server.c
index 7e368ce9d8e..5a9fcd8b69c 100644
--- a/kerberosIV/src/kadmin/admin_server.c
+++ b/kerberosIV/src/kadmin/admin_server.c
@@ -116,7 +116,8 @@ cleanexit(int val)
static RETSIGTYPE
sigalrm(int sig)
{
- cleanexit(1);
+ kerb_fini(); /* not a signal race -- kerb_fini() does NOTHING */
+ _exit(val);
}
/*
diff --git a/kerberosIV/src/kadmin/kadmin.c b/kerberosIV/src/kadmin/kadmin.c
index 30c7d63306b..6fe636da434 100644
--- a/kerberosIV/src/kadmin/kadmin.c
+++ b/kerberosIV/src/kadmin/kadmin.c
@@ -351,7 +351,7 @@ clean_up()
static int
clean_up_cmd (int argc, char **argv)
{
- clean_up();
+ clean_up(); /* roughly said, signal safe */
return 0;
}
@@ -435,8 +435,13 @@ do_init(int argc, char **argv)
static void
sigalrm(int sig)
{
- if(clean_up())
- printf("\nTickets destroyed.\n");
+ int save_errno = errno;
+
+ if(clean_up()) { /* roughly said, signal safe */
+ write(STDOUT_FILENO, "\nTickets destroyed.\n",
+ strlen("\nTickets destroyed.\n"));
+ }
+ errno = save_errno;
}
int