summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dirmngr/dirmngr.c9
-rw-r--r--doc/dirmngr.texi7
2 files changed, 14 insertions, 2 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c
index 57f515b40..9528ba91b 100644
--- a/dirmngr/dirmngr.c
+++ b/dirmngr/dirmngr.c
@@ -221,7 +221,7 @@ static gpgrt_opt_t opts[] = {
ARGPARSE_s_i (oListenBacklog, "listen-backlog", "@"),
ARGPARSE_s_i (oMaxReplies, "max-replies",
N_("|N|do not return more than N items in one query")),
- ARGPARSE_s_u (oFakedSystemTime, "faked-system-time", "@"), /*(epoch time)*/
+ ARGPARSE_s_s (oFakedSystemTime, "faked-system-time", "@"),
ARGPARSE_s_n (oDisableCheckOwnSocket, "disable-check-own-socket", "@"),
ARGPARSE_s_s (oIgnoreCert,"ignore-cert", "@"),
ARGPARSE_s_s (oIgnoreCertExtension,"ignore-cert-extension", "@"),
@@ -1179,7 +1179,12 @@ main (int argc, char **argv)
case oLDAPAddServers: opt.add_new_ldapservers = 1; break;
case oFakedSystemTime:
- gnupg_set_time ((time_t)pargs.r.ret_ulong, 0);
+ {
+ time_t faked_time = isotime2epoch (pargs.r.ret_str);
+ if (faked_time == (time_t)(-1))
+ faked_time = (time_t)strtoul (pargs.r.ret_str, NULL, 10);
+ gnupg_set_time (faked_time, 0);
+ }
break;
case oForce: opt.force = 1; break;
diff --git a/doc/dirmngr.texi b/doc/dirmngr.texi
index 0bf35b72f..fb448752a 100644
--- a/doc/dirmngr.texi
+++ b/doc/dirmngr.texi
@@ -175,6 +175,13 @@ names and are OR-ed together. The special flag "none" clears the list
and allows to start over with an empty list. To get a list of
available flags the sole word "help" can be used.
+@item --faked-system-time @var{epoch}
+@opindex faked-system-time
+This option is only useful for testing; it sets the system time back or
+forth to @var{epoch} which is the number of seconds elapsed since the year
+1970. Alternatively @var{epoch} may be given as a full ISO time string
+(e.g. "20070924T154812").
+
@item --debug-level @var{level}
@opindex debug-level
Select the debug level for investigating problems. @var{level} may be a