mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-17 14:07:03 +01:00
* sysutils.c (disable_core_dumps): Only set the current limit.
(enable_core_dumps): New. * gpgsm.texi (Esoteric Options): Add --debug-allow-core-dump. * gpgsm.c: New option --debug-allow-core-dump. * gpgsm.h (opt): Add member CONFIG_FILENAME. * gpgsm.c (main): Use it here instead of the local var. * server.c (gpgsm_server): Print some additional information with the hello in verbose mode.
This commit is contained in:
parent
13b6205066
commit
ac791c0a9a
@ -1,3 +1,8 @@
|
|||||||
|
2004-05-11 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* sysutils.c (disable_core_dumps): Only set the current limit.
|
||||||
|
(enable_core_dumps): New.
|
||||||
|
|
||||||
2004-04-13 Werner Koch <wk@gnupg.org>
|
2004-04-13 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* simple-pwquery.c (copy_and_escape): Relaxed quoting.
|
* simple-pwquery.c (copy_and_escape): Relaxed quoting.
|
||||||
|
@ -70,21 +70,44 @@ trap_unaligned(void)
|
|||||||
int
|
int
|
||||||
disable_core_dumps (void)
|
disable_core_dumps (void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DOSISH_SYSTEM
|
#ifdef HAVE_DOSISH_SYSTEM
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SETRLIMIT
|
# ifdef HAVE_SETRLIMIT
|
||||||
struct rlimit limit;
|
struct rlimit limit;
|
||||||
|
|
||||||
|
/* We only set the current limit unless we were not able to
|
||||||
|
retrieve the old value. */
|
||||||
|
if (getrlimit (RLIMIT_CORE, &limit))
|
||||||
|
limit.rlim_max = 0;
|
||||||
limit.rlim_cur = 0;
|
limit.rlim_cur = 0;
|
||||||
limit.rlim_max = 0;
|
if( !setrlimit (RLIMIT_CORE, &limit) )
|
||||||
if( !setrlimit( RLIMIT_CORE, &limit ) )
|
|
||||||
return 0;
|
return 0;
|
||||||
if( errno != EINVAL && errno != ENOSYS )
|
if( errno != EINVAL && errno != ENOSYS )
|
||||||
log_fatal (_("can't disable core dumps: %s\n"), strerror(errno) );
|
log_fatal (_("can't disable core dumps: %s\n"), strerror(errno) );
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
enable_core_dumps (void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DOSISH_SYSTEM
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
# ifdef HAVE_SETRLIMIT
|
||||||
|
struct rlimit limit;
|
||||||
|
|
||||||
|
if (getrlimit (RLIMIT_CORE, &limit))
|
||||||
|
return 1;
|
||||||
|
limit.rlim_cur = limit.rlim_max;
|
||||||
|
setrlimit (RLIMIT_CORE, &limit);
|
||||||
|
return 1; /* We always return true because trhis function is
|
||||||
|
merely a debugging aid. */
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
void trap_unaligned (void);
|
void trap_unaligned (void);
|
||||||
int disable_core_dumps (void);
|
int disable_core_dumps (void);
|
||||||
|
int enable_core_dumps (void);
|
||||||
const unsigned char *get_session_marker (size_t *rlen);
|
const unsigned char *get_session_marker (size_t *rlen);
|
||||||
int check_permissions (const char *path,int extension,int checkonly);
|
int check_permissions (const char *path,int extension,int checkonly);
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2004-05-11 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* gpgsm.texi (Esoteric Options): Add --debug-allow-core-dump.
|
||||||
|
|
||||||
2004-05-03 Werner Koch <wk@gnupg.org>
|
2004-05-03 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* gpg-agent.texi (Agent Options): Add --allow-mark-trusted.
|
* gpg-agent.texi (Agent Options): Add --allow-mark-trusted.
|
||||||
|
@ -444,6 +444,14 @@ Note, that all flags set using this option may get overriden by
|
|||||||
@opindex debug-all
|
@opindex debug-all
|
||||||
Same as @code{--debug=0xffffffff}
|
Same as @code{--debug=0xffffffff}
|
||||||
|
|
||||||
|
@item --debug-allow-core-dump
|
||||||
|
@opindex debug-allow-core-dump
|
||||||
|
Usually gpgsm tries to avoid dumping core by well written code and by
|
||||||
|
disabling core dumps for security reasons. However, bugs are pretty
|
||||||
|
durable beasts and to squash them it is sometimes useful to have a core
|
||||||
|
dump. This option enables core dumps unless the Bad Thing happened
|
||||||
|
before the option parsing.
|
||||||
|
|
||||||
@item --debug-no-chain-validation
|
@item --debug-no-chain-validation
|
||||||
@opindex debug-no-chain-validation
|
@opindex debug-no-chain-validation
|
||||||
This is actually not a debugging option but only useful as such. It
|
This is actually not a debugging option but only useful as such. It
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
2004-05-11 Werner Koch <wk@gnupg.org>
|
2004-05-11 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* gpgsm.c: New option --debug-allow-core-dump.
|
||||||
|
|
||||||
* gpgsm.h (opt): Add member CONFIG_FILENAME.
|
* gpgsm.h (opt): Add member CONFIG_FILENAME.
|
||||||
* gpgsm.c (main): Use it here instead of the local var.
|
* gpgsm.c (main): Use it here instead of the local var.
|
||||||
|
|
||||||
* server.c (gpgsm_server): Print some additional information with
|
* server.c (gpgsm_server): Print some additional information with
|
||||||
the hello in verbose mode.
|
the hello in verbose mode.
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ enum cmd_and_opt_values {
|
|||||||
oDebugLevel,
|
oDebugLevel,
|
||||||
oDebugAll,
|
oDebugAll,
|
||||||
oDebugWait,
|
oDebugWait,
|
||||||
|
oDebugAllowCoreDump,
|
||||||
oDebugNoChainValidation,
|
oDebugNoChainValidation,
|
||||||
oDebugIgnoreExpiration,
|
oDebugIgnoreExpiration,
|
||||||
oLogFile,
|
oLogFile,
|
||||||
@ -335,6 +336,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
{ oDebugLevel, "debug-level" ,2, "@"},
|
{ oDebugLevel, "debug-level" ,2, "@"},
|
||||||
{ oDebugAll, "debug-all" ,0, "@"},
|
{ oDebugAll, "debug-all" ,0, "@"},
|
||||||
{ oDebugWait, "debug-wait" ,1, "@"},
|
{ oDebugWait, "debug-wait" ,1, "@"},
|
||||||
|
{ oDebugAllowCoreDump, "debug-allow-core-dump", 0, "@" },
|
||||||
{ oDebugNoChainValidation, "debug-no-chain-validation", 0, "@"},
|
{ oDebugNoChainValidation, "debug-no-chain-validation", 0, "@"},
|
||||||
{ oDebugIgnoreExpiration, "debug-ignore-expiration", 0, "@"},
|
{ oDebugIgnoreExpiration, "debug-ignore-expiration", 0, "@"},
|
||||||
{ oStatusFD, "status-fd" ,1, N_("|FD|write status info to this FD") },
|
{ oStatusFD, "status-fd" ,1, N_("|FD|write status info to this FD") },
|
||||||
@ -1010,6 +1012,9 @@ main ( int argc, char **argv)
|
|||||||
case oDebugAll: opt.debug = ~0; break;
|
case oDebugAll: opt.debug = ~0; break;
|
||||||
case oDebugLevel: debug_level = pargs.r.ret_str; break;
|
case oDebugLevel: debug_level = pargs.r.ret_str; break;
|
||||||
case oDebugWait: debug_wait = pargs.r.ret_int; break;
|
case oDebugWait: debug_wait = pargs.r.ret_int; break;
|
||||||
|
case oDebugAllowCoreDump:
|
||||||
|
may_coredump = enable_core_dumps ();
|
||||||
|
break;
|
||||||
case oDebugNoChainValidation: opt.no_chain_validation = 1; break;
|
case oDebugNoChainValidation: opt.no_chain_validation = 1; break;
|
||||||
case oDebugIgnoreExpiration: opt.ignore_expiration = 1; break;
|
case oDebugIgnoreExpiration: opt.ignore_expiration = 1; break;
|
||||||
|
|
||||||
|
@ -811,7 +811,7 @@ gpgsm_server (certlist_t default_recplist)
|
|||||||
assuan_strerror(rc));
|
assuan_strerror(rc));
|
||||||
gpgsm_exit (2);
|
gpgsm_exit (2);
|
||||||
}
|
}
|
||||||
if (opt.verbose)
|
if (opt.verbose || opt.debug)
|
||||||
{
|
{
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
const char *s1 = getenv ("GPG_AGENT_INFO");
|
const char *s1 = getenv ("GPG_AGENT_INFO");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user