aboutsummaryrefslogtreecommitdiffstats
path: root/g10/signal.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-07-10 14:30:07 +0000
committerDavid Shaw <[email protected]>2003-07-10 14:30:07 +0000
commitf4617d97b8abaa4d693527df89c6149ac2c937e6 (patch)
tree413e440d2f2585956cd5c2cda77f492fcb96f62d /g10/signal.c
parent* DETAILS: Document the --attribute-fd data. (diff)
downloadgnupg-f4617d97b8abaa4d693527df89c6149ac2c937e6.tar.gz
gnupg-f4617d97b8abaa4d693527df89c6149ac2c937e6.zip
* parse-packet.c (parse_signature): No need to reserve 8 bytes for the
unhashed signature cache any longer. * misc.c (pct_expando): Add two new expandos - signer's fingerprint (%g), and signer's primary fingerprint (%p). * Makefile.am: Include W32LIBS where appropriate. * g10.c (main): Add --rfc2440 alias for --openpgp since in a few months, they won't be the same thing. * keyserver.c (parse_keyserver_uri): Accept "http" as an alias for "hkp", since it is occasionally written that way. (keyserver_spawn): Use ascii_isspace to avoid locale issues. * keygen.c (ask_user_id): Make --allow-freeform-uid apply to the email field as well as the name field, and allow mixing fields when it is set. * options.skel: Use subkeys.pgp.net as the default keyserver. * trustdb.c (validate_one_keyblock): Certifications on revoked or expired uids do not count in the web of trust. * signal.c (init_one_signal, pause_on_sigusr, do_block): Only use sigprocmask() if we have sigset_t, and only use sigaction() if we have struct sigaction. This is for Forte c89 on Solaris which seems to define only the function call half of the two pairs by default. (pause_on_sigusr): Typo. (do_block): If we can't use sigprocmask() and sigset_t, try to get the number of signals from NSIG as well as MAXSIG, and if we can't, fail with an explanation. * signal.c, tdbio.c: Comment out the transaction code. It was not used in this version, and was causing some build problems on quasi-posix platforms (Solaris and Forte c89). * keylist.c (list_keyblock_colon): Don't include validity values when listing secret keys since they can be incorrect and/or misleading. This is a temporary kludge, and will be handled properly in 1.9/2.0. * mainproc.c (check_sig_and_print): Only show the "key available from" preferred keyserver line if the key is not currently present. * keyedit.c (sign_uids): Do not sign expired uids without --expert (same behavior as revoked uids). Do not allow signing a user ID without a self-signature. --expert overrides. Add additional prompt to the signature level question. (menu_expire): When changing expiration dates, don't replace selfsigs on revoked uids since this would effectively unrevoke them. There is also no point in replacing expired selfsigs. This is bug #181 * g10.c (add_notation_data): Make sure that only ascii is passed to iscntrl. Noted by Christian Biere. * getkey.c (classify_user_id2): Replaced isspace by spacep * keygen.c (ask_user_id): Ditto. (get_parameter_algo): Ditto. * keyedit.c (keyedit_menu): Ditto. * tdbdump.c (import_ownertrust): Ditto. s/isxdigit/hexdigitp/. * revoke.c (ask_revocation_reason): * keyserver.c (keyserver_spawn): Dito.
Diffstat (limited to 'g10/signal.c')
-rw-r--r--g10/signal.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/g10/signal.c b/g10/signal.c
index 1028ab705..ced507b83 100644
--- a/g10/signal.c
+++ b/g10/signal.c
@@ -1,5 +1,5 @@
/* signal.c - signal handling
- * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -34,7 +34,6 @@
#include "main.h"
#include "ttyio.h"
-
static volatile int caught_fatal_sig = 0;
static volatile int caught_sigusr1 = 0;
@@ -42,7 +41,7 @@ static void
init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign )
{
#ifndef HAVE_DOSISH_SYSTEM
-#ifdef HAVE_SIGACTION
+#if defined(HAVE_SIGACTION) && defined(HAVE_STRUCT_SIGACTION)
struct sigaction oact, nact;
if (check_ign) {
@@ -132,7 +131,7 @@ void
pause_on_sigusr( int which )
{
#ifndef HAVE_DOSISH_SYSTEM
-#ifdef HAVE_SIGPROCMASK
+#if defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSET_T)
sigset_t mask, oldmask;
assert( which == 1 );
@@ -150,18 +149,19 @@ pause_on_sigusr( int which )
while (!caught_sigusr1)
sigpause(SIGUSR1);
caught_sigusr1 = 0;
- sigrelse(SIGUSR1); ????
-#endif /*!HAVE_SIGPROCMASK*/
+ sigrelse(SIGUSR1);
+#endif /*! HAVE_SIGPROCMASK && HAVE_SIGSET_T */
#endif
}
-
+/* Disabled - see comment in tdbio.c:tdbio_begin_transaction() */
+#if 0
static void
do_block( int block )
{
#ifndef HAVE_DOSISH_SYSTEM
static int is_blocked;
-#ifdef HAVE_SIGPROCMASK
+#if defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSET_T)
static sigset_t oldmask;
if( block ) {
@@ -179,14 +179,23 @@ do_block( int block )
sigprocmask( SIG_SETMASK, &oldmask, NULL );
is_blocked = 0;
}
-#else /*!HAVE_SIGPROCMASK*/
- static void (*disposition[MAXSIG])();
+#else /*! HAVE_SIGPROCMASK && HAVE_SIGSET_T */
+
+#if defined(NSIG)
+#define SIGSMAX (NSIG)
+#elif defined(MAXSIG)
+#define SIGSMAX (MAXSIG+1)
+#else
+#error "define SIGSMAX to the number of signals on your platform plus one"
+#endif
+
+ static void (*disposition[SIGSMAX])(int);
int sig;
if( block ) {
if( is_blocked )
log_bug("signals are already blocked\n");
- for (sig=1; sig < MAXSIG; sig++) {
+ for (sig=1; sig < SIGSMAX; sig++) {
disposition[sig] = sigset (sig, SIG_HOLD);
}
is_blocked = 1;
@@ -194,16 +203,15 @@ do_block( int block )
else {
if( !is_blocked )
log_bug("signals are not blocked\n");
- for (sig=1; sig < MAXSIG; sig++) {
+ for (sig=1; sig < SIGSMAX; sig++) {
sigset (sig, disposition[sig]);
}
is_blocked = 0;
}
-#endif /*!HAVE_SIGPROCMASK*/
+#endif /*! HAVE_SIGPROCMASK && HAVE_SIGSET_T */
#endif /*HAVE_DOSISH_SYSTEM*/
}
-
void
block_all_signals()
{
@@ -215,3 +223,4 @@ unblock_all_signals()
{
do_block(0);
}
+#endif