AC_CHECK_LIB(dbm,main)
AC_FUNC_CHECK(waitpid,AC_DEFINE(HAVE_WAITPID))
AC_FUNC_CHECK(vsprintf,AC_DEFINE(HAVE_VSPRINTF))
+CHECK_SIGNALS
+CHECK_SETJMP
CHECK_WAIT_TYPE
ET_RULES
KRB_INCLUDE
static krb5_sigtype
proto_alarmclock()
{
+#if POSIX_SETJMP
+ siglongjmp(timeout_jmp, 1);
+#else /* POSIX_SETJMP */
longjmp(timeout_jmp, 1);
+#endif /* POSIX_SETJMP */
/* NOTREACHED */
}
krb5_address *local;
krb5_address *remote;
+#if POSIX_SIGNALS
+ struct sigaction s_action;
+#endif /* POSIX_SIGNALS */
+
char *curr_lang = (char *) NULL;
krb5_boolean mime_setting = 0;
remote = (krb5_address *) NULL;
ticket = (krb5_ticket *) NULL;
rcache = (krb5_rcache) NULL;
+#if POSIX_SIGNALS
+ (void) sigemptyset(&s_action.sa_mask);
+ s_action.sa_flags = 0;
+#endif /* POSIX_SIGNALS */
/* Get memory for addresses */
local = (krb5_address *) malloc(sizeof(krb5_address));
*
* If enabled, the protocol times out after proto_proto_timeout seconds.
*/
- if (setjmp(timeout_jmp) == 0) {
+ if (
+#if POSIX_SETJMP
+ sigsetjmp(timeout_jmp, 1) == 0
+#else /* POSIX_SETJMP */
+ setjmp(timeout_jmp) == 0
+#endif /* POSIX_SETJMP */
+ ) {
if (proto_proto_timeout > 0) {
+#if POSIX_SIGNALS
+ s_action.sa_handler = proto_alarmclock;
+ (void) sigaction(SIGALRM, &s_action, (struct sigaction *) NULL);
+#else /* POSIX_SIGNALS */
signal(SIGALRM, proto_alarmclock);
+#endif /* POSIX_SIGNALS */
}
/*
* Loop forever - or until somebody puts us out of our misery.
char *acl_file;
{
krb5_error_code kret;
+#if POSIX_SIGNALS
+ struct sigaction s_action;
+#endif /* POSIX_SIGNALS */
kret = 0;
acl_debug_level = debug_level;
((acl_file) ? acl_file : "(null)")));
acl_acl_file = (acl_file) ? acl_file : (char *) acl_default_file;
acl_inited = acl_load_acl_file();
+#if POSIX_SIGNALS
+ (void) sigemptyset(&s_action.sa_mask);
+ s_action.sa_flags = 0;
+ s_action.sa_handler = acl_reload_acl_file;
+ (void) sigaction(SIGALRM, &s_action, (struct sigaction *) NULL);
+#else /* POSIX_SIGNALS */
signal(SIGHUP, acl_reload_acl_file);
+#endif /* POSIX_SIGNALS */
DPRINT(DEBUG_CALLS, acl_debug_level, ("X acl_init() = %d\n", kret));
return(kret);
}
unhandled_signal(signo)
int signo;
{
+#if POSIX_SETJMP
+ siglongjmp(terminal_jmp, signo);
+#else /* POSIX_SETJMP */
longjmp(terminal_jmp, signo);
+#endif /* POSIX_SETJMP */
/* NOTREACHED */
}
openlog(programname, LOG_AUTH|LOG_CONS|LOG_NDELAY|LOG_PID, LOG_LOCAL6);
(void) set_com_err_hook(kadm_com_err_proc);
- if ((signal_number = setjmp(terminal_jmp)) == 0) {
+ if ((signal_number =
+#if POSIX_SETJMP
+ sigsetjmp(terminal_jmp, 1)
+#else /* POSIX_SETJMP */
+ setjmp(terminal_jmp)
+#endif /* POSIX_SETJMP */
+ ) == 0) {
+#if POSIX_SIGNALS
+ struct sigaction s_action;
+#endif /* POSIX_SIGNALS */
+
/*
* Initialize signal handling.
*/
+#if POSIX_SIGNALS
+ (void) sigemptyset(&s_action.sa_mask);
+ s_action.sa_flags = 0;
+ s_action.sa_handler = unhandled_signal;
+ (void) sigaction(SIGINT, &s_action, (struct sigaction *) NULL);
+ (void) sigaction(SIGTERM, &s_action, (struct sigaction *) NULL);
+ (void) sigaction(SIGHUP, &s_action, (struct sigaction *) NULL);
+ (void) sigaction(SIGQUIT, &s_action, (struct sigaction *) NULL);
+ (void) sigaction(SIGPIPE, &s_action, (struct sigaction *) NULL);
+ (void) sigaction(SIGALRM, &s_action, (struct sigaction *) NULL);
+ (void) sigaction(SIGCHLD, &s_action, (struct sigaction *) NULL);
+#else /* POSIX_SIGNALS */
signal(SIGINT, unhandled_signal);
signal(SIGTERM, unhandled_signal);
signal(SIGHUP, unhandled_signal);
signal(SIGPIPE, unhandled_signal);
signal(SIGALRM, unhandled_signal);
signal(SIGCHLD, unhandled_signal);
+#endif /* POSIX_SIGNALS */
/*
* Initialize our modules.