Re: grdc: show timezone when TZ is set

2022-09-23 Thread Florian Obser
deraadt objected to the time zone validation. I don't care about the feature and I agree with the point that I shouldn't do it because there is no API for it. I don't even know where the time zone files are. To make this all more symmetric always print tm_zone, even if TZ is not set. OK? diff --

Re: grdc: show timezone when TZ is set

2022-09-23 Thread Florian Obser
So, with the tzset(3) restriction in place I'd like to fix grdc, because what we currently have is wrong: There are time zones that have minute offsets, display those correctly. Pointed out by pjanzen@. To display the offset, use ISO 8601, as suggested by David Goerger. Take a guess if tzset(3) w

Re: grdc: show timezone when TZ is set

2022-09-18 Thread Steffen Nurpmeso
David Goerger wrote in : |Sunday, 20220918 13:38+, Florian Obser wrote: |>I'm happy with that, let's do this then |>- fix the offset calculation |>- output tm->tm_zone in addition to TZ to be able to spot typos. | |I like the overall diff (thanks!), but one minor formatting nit is that

Re: grdc: show timezone when TZ is set

2022-09-18 Thread David Goerger
Sunday, 20220918 13:38+, Florian Obser wrote: I'm happy with that, let's do this then - fix the offset calculation - output tm->tm_zone in addition to TZ to be able to spot typos. I like the overall diff (thanks!), but one minor formatting nit is that I believe it's more common under ISO 86

Re: grdc: show timezone when TZ is set

2022-09-18 Thread Theo de Raadt
Paul Janzen wrote: > My issues with the time system are (a) it has to "just work", so it flees > to UTC the instant something goes wrong, but never makes available any > status as to whether the asked-for time zone is the one returned, except > for (b) my program aborts if I'm pledged and I go do

Re: grdc: show timezone when TZ is set

2022-09-18 Thread Paul Janzen
> I disagree with the full-featured support of tzset() for all TZ paths. > > and, of course your private Monticello file is corrupt TZ file, which > exercises > a secret bug in the libc/time parser of the file, and you rely upon it to take > over control of this program, and other programs. > >

Re: grdc: show timezone when TZ is set

2022-09-18 Thread Florian Obser
I'm happy with that, let's do this then - fix the offset calculation - output tm->tm_zone in addition to TZ to be able to spot typos. OK? diff --git grdc.c grdc.c index 66e5eee79e6..05b1ff1ea87 100644 --- grdc.c +++ grdc.c @@ -185,9 +185,12 @@ main(int argc, char *argv[])

Re: grdc: show timezone when TZ is set

2022-09-18 Thread Theo de Raadt
Paul Janzen wrote: > Yeah, I know with pledge() you can't do testing like > TZ=:/home/pjanzen/dev/usr/share/zoneinfo/testing/2022/America/Kentucky/Monticello > any more, even though that's a perfectly cromulent and functional TZ on my > system otherwise. So for the time being, probably any TZ tha

Re: grdc: show timezone when TZ is set

2022-09-18 Thread Florian Obser
On 2022-09-18 01:55 -04, Paul Janzen wrote: > The recent change to grdc(6), to display additional information if TZ is > set, has a few issues. > > 1. Time zone offset incorrectly reported in Newfoundland. > > Some time zones have offsets of 30 or 45 minutes. The displayed time > offset is curre

Re: grdc: show timezone when TZ is set

2022-09-17 Thread Paul Janzen
The recent change to grdc(6), to display additional information if TZ is set, has a few issues. 1. Time zone offset incorrectly reported in Newfoundland. Some time zones have offsets of 30 or 45 minutes. The displayed time offset is currently truncated to the closest hour. (Australia/Eucla is

Re: grdc: show timezone when TZ is set

2022-09-17 Thread Klemens Nanni
On Sat, Sep 17, 2022 at 12:13:16PM +0200, Florian Obser wrote: > Good catch, I have adapted the text from date(1) for this, I think it > flows nicer and dropped the example. > > Update diff with a local variable for getenv(3) and pulled the call up, > it's not going to change during runtime. > >

Re: grdc: show timezone when TZ is set

2022-09-17 Thread Florian Obser
On 2022-09-17 08:42 UTC, Klemens Nanni wrote: > On Sat, Sep 17, 2022 at 09:40:27AM +0200, Florian Obser wrote: >> On 2021-10-24 03:06 +02, James Russell Stickney wrote: >> > I recently found myself wanting to moniter local time from a number of >> > locations around the world. >> > Setting the T

Re: grdc: show timezone when TZ is set

2022-09-17 Thread Klemens Nanni
On Sat, Sep 17, 2022 at 09:40:27AM +0200, Florian Obser wrote: > On 2021-10-24 03:06 +02, James Russell Stickney wrote: > > I recently found myself wanting to moniter local time from a number of > > locations around the world. > > Setting the TZ environment variable on grdc did a wonderfull job a

Re: grdc: show timezone when TZ is set

2022-09-17 Thread Florian Obser
On 2021-10-24 03:06 +02, James Russell Stickney wrote: > I recently found myself wanting to moniter local time from a number of > locations around the world. > Setting the TZ environment variable on grdc did a wonderfull job at this. > At which point, I wanted to know which clock was showing what