summaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2002-06-13 13:45:36 +0200
committerWerner Koch <wk@gnupg.org>2002-06-13 13:45:36 +0200
commit4e13426c92139fb4ecbb8fcb89da921456277e26 (patch)
tree87a4be4115bb27ca8790b9ba9969dfce6bbae961 /sm
parent* call-dirmngr.c (lookup_status_cb): New. (diff)
downloadgnupg2-4e13426c92139fb4ecbb8fcb89da921456277e26.tar.xz
gnupg2-4e13426c92139fb4ecbb8fcb89da921456277e26.zip
* gpgsm.c (main): New option --log-file.
Diffstat (limited to 'sm')
-rw-r--r--sm/ChangeLog4
-rw-r--r--sm/gpgsm.c11
2 files changed, 15 insertions, 0 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 6cd7e7d83..022ecea8e 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,3 +1,7 @@
+2002-06-13 Werner Koch <wk@gnupg.org>
+
+ * gpgsm.c (main): New option --log-file.
+
2002-06-12 Werner Koch <wk@gnupg.org>
* call-dirmngr.c (lookup_status_cb): New.
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 9ed6623c7..de62088bc 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -81,6 +81,7 @@ enum cmd_and_opt_values {
oDebug,
oDebugAll,
oDebugWait,
+ oLogFile,
oEnableSpecialFilenames,
@@ -225,6 +226,7 @@ static ARGPARSE_OPTS opts[] = {
{ aExport, "export", 256 , N_("export certificates")},
{ aLearnCard, "learn-card", 256 ,N_("register a smartcard")},
{ aServer, "server", 256, N_("run in server mode")},
+ { oLogFile, "log-file" ,2, N_("use a log file for the server")},
{ 301, NULL, 0, N_("@\nOptions:\n ") },
@@ -583,6 +585,7 @@ main ( int argc, char **argv)
int parse_debug = 0;
int default_config =1;
int default_keyring = 1;
+ char *logfile = NULL;
int greeting = 0;
int nogreeting = 0;
int debug_wait = 0;
@@ -821,6 +824,8 @@ main ( int argc, char **argv)
opt.verbose = 0;
gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
break;
+
+ case oLogFile: logfile = pargs.r.ret_str; break;
case oBatch:
opt.batch = 1;
@@ -983,6 +988,12 @@ main ( int argc, char **argv)
if (may_coredump && !opt.quiet)
log_info (_("WARNING: program may create a core file!\n"));
+ if (logfile)
+ {
+ log_set_file (logfile);
+ log_set_prefix (NULL, 1|2|4);
+ }
+
if (gnupg_faked_time_p ())
{
log_info (_("WARNING: running with faked system time: "));