mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
* 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.
This commit is contained in:
parent
0848d55ff3
commit
421823cee3
@ -1,3 +1,20 @@
|
|||||||
|
2003-06-14 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* 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 <wk@gnupg.org>
|
2003-06-10 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* parse-packet.c (parse): Disallow old style partial length for
|
* parse-packet.c (parse): Disallow old style partial length for
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* keylist.c
|
/* 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.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -649,7 +649,7 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
|
|||||||
pk = NULL;
|
pk = NULL;
|
||||||
sk = node->pkt->pkt.secret_key;
|
sk = node->pkt->pkt.secret_key;
|
||||||
keyid_from_sk( sk, keyid );
|
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 ),
|
nbits_from_sk( sk ),
|
||||||
sk->pubkey_algo,
|
sk->pubkey_algo,
|
||||||
(ulong)keyid[0],(ulong)keyid[1],
|
(ulong)keyid[0],(ulong)keyid[1],
|
||||||
@ -713,13 +713,17 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
|
|||||||
*/
|
*/
|
||||||
if( any ) {
|
if( any ) {
|
||||||
char *str=node->pkt->pkt.user_id->attrib_data?"uat":"uid";
|
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);
|
printf("%s:r::::::::",str);
|
||||||
else if ( node->pkt->pkt.user_id->is_expired )
|
else if ( node->pkt->pkt.user_id->is_expired )
|
||||||
printf("%s:e::::::::",str);
|
printf("%s:e::::::::",str);
|
||||||
else if ( opt.no_expensive_trust_checks ) {
|
else if ( opt.no_expensive_trust_checks )
|
||||||
printf("%s:::::::::",str);
|
printf("%s:::::::::",str);
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
int uid_validity;
|
int uid_validity;
|
||||||
|
|
||||||
|
32
g10/signal.c
32
g10/signal.c
@ -1,5 +1,5 @@
|
|||||||
/* signal.c - signal handling
|
/* 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.
|
* This file is part of GnuPG.
|
||||||
*
|
*
|
||||||
@ -34,7 +34,6 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "ttyio.h"
|
#include "ttyio.h"
|
||||||
|
|
||||||
|
|
||||||
static volatile int caught_fatal_sig = 0;
|
static volatile int caught_fatal_sig = 0;
|
||||||
static volatile int caught_sigusr1 = 0;
|
static volatile int caught_sigusr1 = 0;
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ static void
|
|||||||
init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign )
|
init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign )
|
||||||
{
|
{
|
||||||
#ifndef HAVE_DOSISH_SYSTEM
|
#ifndef HAVE_DOSISH_SYSTEM
|
||||||
#ifdef HAVE_SIGACTION
|
#if defined(HAVE_SIGACTION) && defined(HAVE_STRUCT_SIGACTION)
|
||||||
struct sigaction oact, nact;
|
struct sigaction oact, nact;
|
||||||
|
|
||||||
if (check_ign) {
|
if (check_ign) {
|
||||||
@ -132,7 +131,7 @@ void
|
|||||||
pause_on_sigusr( int which )
|
pause_on_sigusr( int which )
|
||||||
{
|
{
|
||||||
#ifndef HAVE_DOSISH_SYSTEM
|
#ifndef HAVE_DOSISH_SYSTEM
|
||||||
#ifdef HAVE_SIGPROCMASK
|
#if defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSET_T)
|
||||||
sigset_t mask, oldmask;
|
sigset_t mask, oldmask;
|
||||||
|
|
||||||
assert( which == 1 );
|
assert( which == 1 );
|
||||||
@ -150,8 +149,8 @@ pause_on_sigusr( int which )
|
|||||||
while (!caught_sigusr1)
|
while (!caught_sigusr1)
|
||||||
sigpause(SIGUSR1);
|
sigpause(SIGUSR1);
|
||||||
caught_sigusr1 = 0;
|
caught_sigusr1 = 0;
|
||||||
sigrelse(SIGUSR1); ????
|
sigrelse(SIGUSR1);
|
||||||
#endif /*!HAVE_SIGPROCMASK*/
|
#endif /*! HAVE_SIGPROCMASK && HAVE_SIGSET_T */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +160,7 @@ do_block( int block )
|
|||||||
{
|
{
|
||||||
#ifndef HAVE_DOSISH_SYSTEM
|
#ifndef HAVE_DOSISH_SYSTEM
|
||||||
static int is_blocked;
|
static int is_blocked;
|
||||||
#ifdef HAVE_SIGPROCMASK
|
#if defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSET_T)
|
||||||
static sigset_t oldmask;
|
static sigset_t oldmask;
|
||||||
|
|
||||||
if( block ) {
|
if( block ) {
|
||||||
@ -179,14 +178,23 @@ do_block( int block )
|
|||||||
sigprocmask( SIG_SETMASK, &oldmask, NULL );
|
sigprocmask( SIG_SETMASK, &oldmask, NULL );
|
||||||
is_blocked = 0;
|
is_blocked = 0;
|
||||||
}
|
}
|
||||||
#else /*!HAVE_SIGPROCMASK*/
|
#else /*! HAVE_SIGPROCMASK && HAVE_SIGSET_T */
|
||||||
static void (*disposition[MAXSIG])();
|
|
||||||
|
#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;
|
int sig;
|
||||||
|
|
||||||
if( block ) {
|
if( block ) {
|
||||||
if( is_blocked )
|
if( is_blocked )
|
||||||
log_bug("signals are already blocked\n");
|
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);
|
disposition[sig] = sigset (sig, SIG_HOLD);
|
||||||
}
|
}
|
||||||
is_blocked = 1;
|
is_blocked = 1;
|
||||||
@ -194,12 +202,12 @@ do_block( int block )
|
|||||||
else {
|
else {
|
||||||
if( !is_blocked )
|
if( !is_blocked )
|
||||||
log_bug("signals are not blocked\n");
|
log_bug("signals are not blocked\n");
|
||||||
for (sig=1; sig < MAXSIG; sig++) {
|
for (sig=1; sig < SIGSMAX; sig++) {
|
||||||
sigset (sig, disposition[sig]);
|
sigset (sig, disposition[sig]);
|
||||||
}
|
}
|
||||||
is_blocked = 0;
|
is_blocked = 0;
|
||||||
}
|
}
|
||||||
#endif /*!HAVE_SIGPROCMASK*/
|
#endif /*! HAVE_SIGPROCMASK && HAVE_SIGSET_T */
|
||||||
#endif /*HAVE_DOSISH_SYSTEM*/
|
#endif /*HAVE_DOSISH_SYSTEM*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user