diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2021-03-02 19:53:07 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2021-03-02 20:01:18 -0500 |
commit | 5f5756ccd985cf37efe13532b0747e903e48c996 (patch) | |
tree | 6fccbfd558a679ae540adc341eefe9b154691996 /src | |
parent | bca9f1bf908177aef63d1df8cc00f7af4e7b15b4 (diff) | |
download | libfaketime-5f5756ccd985cf37efe13532b0747e903e48c996.tar.gz |
Pass through syscall(__NR_clock_gettime) if FAKERANDOM is unset
If FAKERANDOM is unset, we were still intercepting syscall() and
passing it through to clock_gettime, rather than letting it fall
through to real_syscall.
That would have the effect of diverting syscall(__NR_clock_gettime,…)
into the libc invocation of clock_gettime(…) (via real_clock_gettime).
While that probably does the same thing, it's probably a mistake to do
such a diversion when FAKETIME is unset.
Diffstat (limited to 'src')
-rw-r--r-- | src/libfaketime.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libfaketime.c b/src/libfaketime.c index 071be7b..3076578 100644 --- a/src/libfaketime.c +++ b/src/libfaketime.c @@ -3772,7 +3772,7 @@ long syscall(long number, ...) { } #endif // static int (*real_clock_gettime) (clockid_t clk_id, struct timespec *tp); - if (number == __NR_clock_gettime) { + if (number == __NR_clock_gettime && getenv("FAKETIME")) { clockid_t clk_id; struct timespec *tp; clk_id = va_arg(ap, clockid_t); |