Live data from Hacker News

RunAsDate – Run a program with the specified date/time (2019)

nirsoft.net

41–50 of 64 posts

Re: RunAsDate – Run a program with the specified date/time (2019)

#41
Several people have asked in existing threads why you'd want this, so, let's give a very real example that we can guess probably at least one HN reader will be grateful for:

At the end of next month (September 2021) the root CA certificate for DST Root CA X3 expires.

When a new CA comes into existence in the Web PKI they face a significant problem, even if all the brand new shiny software trusts their excellent new CA root, almost everybody at least sometimes needs old software that might not have the latest updates. So, they get an existing trusted CA to sign to say that they trust this new CA.

The charity that provides Let's Encrypt, ISRG, has a root CA named ISRG Root X1 (and a newer one named ISRG Root X2 but that's another matter) but they also sought such cross signatures from IdenTrust, who had bought the Digital Signature Trust and with it DST Root CA X3 in order to "bootstrap" trust on older systems.

So up until late September, a device that has no idea who ISRG are or what Let's Encrypt is, still trusts Let's Encrypt certificates, because it trusts DST Root CA X3. And then the self-signed certificate for DST Root CA X3 expires.

Tools like RunAsDate allow you to test your software to see whether it will still work after that expiry date. It wasn't really practical to run such tests a few months ago, because if in say May you tell the computer it's now the 1st of October all your perfectly good Let's Encrypt certificates issued in April have expired by October, so that's why nothing works. However, since early July it has been possible to have certificates that will not be expired when DST Root CA X3 expires and perform such tests.

Lots of maintainers probably look after systems where they can't (or at least, daren't) add a newer root like ISRG Root X1 and would value knowing in advance that the system will blow up completely at the end of September, rather than being blind-sided when it inevitably happens. RunAsDate (and similar tools on other systems) enable them to find that out with a few weeks left to fix or at least mitigate the problem.

Re: RunAsDate – Run a program with the specified date/time (2019)

#42

Several people have asked in existing threads why you'd want this, so, let's give a very real example that we can guess probably at least one HN reader will be grateful for: At the end of next month (September 2021) the root CA certificate for DST Root CA X3 expires. When a new CA comes into existence in the Web PKI they face a significant problem, even if all the brand new shiny software trusts their excellent new C…

I would assume the reason most people would use this is to spoof simple “trial period” checks on older software. I remember, as a kid, setting the clock back on shareware in order to run the full version. This would make it more convenient since you don’t have to alter system time.

Re: RunAsDate – Run a program with the specified date/time (2019)

#43

Earlier quoted context omitted.

Back in school we used to use it to run SAS 9.4

Timed license or something? I’ve heard of SAS but have never used it. Any good?

Yeah, a free trial.

It's a niche statistical analytics programming language. Used by banks and pharmaceutical companies mostly because it makes it easier to audit things. The open source alternative would be R.

Re: RunAsDate – Run a program with the specified date/time (2019)

#44
NirSoft looks legit with a real person (Nir Sofer) behind it. It also is around for a long time. Moreover people in this and other threads seem to trust NirSoft tools, so I assume they are safe to use. It's a pity that whenever I tried they got quarantined by enterprise end point security (aka virus scanner).

EDIT: I just sent NirSoft's GDIView, which is the tool I tried to use in the past, to virustotal and it sadly gets flagged by two vendors. Now that's only two out of about 70. Unfortunately in large organizations we have no choice, if it gets detected it cannot be used.

Re: RunAsDate – Run a program with the specified date/time (2019)

#45

NirSoft looks legit with a real person (Nir Sofer) behind it. It also is around for a long time. Moreover people in this and other threads seem to trust NirSoft tools, so I assume they are safe to use. It's a pity that whenever I tried they got quarantined by enterprise end point security (aka virus scanner). EDIT: I just sent NirSoft's GDIView, which is the tool I tried to use in the past, to virustotal and it sadly…

Most likely flagged as a generic malware from heuristics because of the API calls their tools use.

Re: RunAsDate – Run a program with the specified date/time (2019)

#48

Hmm, I wonder if there's a way to do this for a whole Docker container?

Time namespacing would achieve this, had it not omitted the real-time clock:

> Note that time namespaces do not virtualize the CLOCK_REALTIME clock. Virtualization of this clock was avoided for reasons of complexity and overhead within the kernel.

Re: RunAsDate – Run a program with the specified date/time (2019)

#49
post #8
post #3

When would this be useful?

I would need RunAsTimezone

On Linux (well, glibc, not sure about other libc implementations) you can just set the `TZ` environment variable before running the app. I wonder if Windows has something similar.

Re: RunAsDate – Run a program with the specified date/time (2019)

#50
post #9
post #6

Is there an equivalent tool for *nix OSes?

faketime '2008-12-24 01:15:43' /bin/date

faketime is great. I use it in continuous integration tests for some software that needs to work correctly in temporal edge cases (near midnight, leap days, etc.)
Post reply on HN