aboutsummaryrefslogtreecommitdiffstats
path: root/common/gettime.c
diff options
context:
space:
mode:
authorDamien Goutte-Gattat <[email protected]>2017-01-18 17:52:12 +0000
committerJustus Winter <[email protected]>2017-01-19 09:39:06 +0000
commit3daeef702b2e6a42f0f396b828f86ffc3f33fc88 (patch)
treefc12a159c0920a7cc991853e1543baa04719f30a /common/gettime.c
parentcommon: Clarify use of vars in buffer copy code. (diff)
downloadgnupg-3daeef702b2e6a42f0f396b828f86ffc3f33fc88.tar.gz
gnupg-3daeef702b2e6a42f0f396b828f86ffc3f33fc88.zip
gpg: Allow to freeze faked system time.
* g10/gpg.c (main): If the parameter for --faked-system-time ends with a '!', freeze time at the specified point. * common/gettime.c (gnupg_set_time): Allow to freeze the time at an arbitrary time instead of only the current time. * doc/gpg.texi: Update documentation for --faked-system-time. -- This patch allows the user to modify the behavior of the --faked-system-time option: by appending a '!' to the parameter, time in GnuPG will be frozen at the specified time, instead of advancing normally from that time onward. Signed-off-by: Damien Goutte-Gattat <[email protected]>
Diffstat (limited to 'common/gettime.c')
-rw-r--r--common/gettime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/gettime.c b/common/gettime.c
index e5da4fb1a..3e1ee5569 100644
--- a/common/gettime.c
+++ b/common/gettime.c
@@ -133,7 +133,7 @@ gnupg_set_time (time_t newtime, int freeze)
else if (freeze)
{
timemode = FROZEN;
- timewarp = current;
+ timewarp = newtime == (time_t)-1 ? current : newtime;
}
else if (newtime > current)
{