diff --git a/g10/ChangeLog b/g10/ChangeLog index 16098ee49..f41ff4752 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,20 @@ +2003-06-14 David Shaw + + * 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. + + * 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. + 2003-06-10 Werner Koch * parse-packet.c (parse): Disallow old style partial length for diff --git a/g10/keylist.c b/g10/keylist.c index 85cd0262b..f102c4b7f 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -1,5 +1,5 @@ /* keylist.c - * Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + * Copyright (C) 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -649,7 +649,7 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr ) pk = NULL; sk = node->pkt->pkt.secret_key; keyid_from_sk( sk, keyid ); - printf("sec:u:%u:%d:%08lX%08lX:%s:%s:::", + printf("sec::%u:%d:%08lX%08lX:%s:%s:::", nbits_from_sk( sk ), sk->pubkey_algo, (ulong)keyid[0],(ulong)keyid[1], @@ -713,13 +713,17 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr ) */ if( any ) { char *str=node->pkt->pkt.user_id->attrib_data?"uat":"uid"; - if ( node->pkt->pkt.user_id->is_revoked ) + /* If we're listing a secret key, leave out the + validity values for now. This is handled better in + 1.9. */ + if ( sk ) + printf("%s:::::::::",str); + else if ( node->pkt->pkt.user_id->is_revoked ) printf("%s:r::::::::",str); else if ( node->pkt->pkt.user_id->is_expired ) printf("%s:e::::::::",str); - else if ( opt.no_expensive_trust_checks ) { + else if ( opt.no_expensive_trust_checks ) printf("%s:::::::::",str); - } else { int uid_validity; diff --git a/g10/signal.c b/g10/signal.c index d381c5741..0f3db8d99 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,8 +149,8 @@ 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 } @@ -161,7 +160,7 @@ 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 +178,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,12 +202,12 @@ 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*/ }