Hi Ted,

Theo de Raadt wrote on Sat, Jan 05, 2019 at 08:31:27PM -0700:
> Ted Unangst <t...@tedunangst.com> wrote:

>> The sample server doesn't work for me,

The sample server does work for me:

   $ host ptbtime1.ptb.de
  ptbtime1.ptb.de has address 192.53.103.108
   $ env TZ=UTC rdate -p ptbtime1.ptb.de
  Sun Jan  6 03:51:29 UTC 2019

However, while decades ago, there probably wasn't much wrong with
abusing central infrastructure like this for examples, nowadays,
that looks like a bad idea.

>> and while the example is a fun
>> hint at the alternate universe of "right" and "legal" times, I don't
>> think this is a good place to suggest actually changing the system
>> timezone.
>> 
>> Demonstrate printing a time modified by TZ instead.

Congrats, you found a documentation bug.

Apparently, the rdate(8) program supports the TZ environment variable,
but the manual page does not say so.  An ENVIRONMENT section is missing
and should be added.  It is not a good idea to give EXAMPLES for stuff
that is accidentally undocumented.

> First off, what a weird example you found.
> 
> But more on the matter.  Is your change even good advice?  pool.ntp.org
> is attackable via unauthenticated DNS, and based upon past experience
> who can say if their administrators can even keep their infrastructure
> secure.  Furthermore, the ntp protocol has no security and can be
> man-in-the-middled to provide lies (in a ntp daemon one can listen to
> many replies and get some confidence, but this rdate example is
> one-shot).
> 
> So at best this gives you a potentially correct answer about Germany,
> not considering the leap second, and not considering TZ database changes
> which seem to be happening continually and "Legally".
> 
> So an alternative proposal: Should this weird EXAMPLES section be deleted?

Even though i occasionally took the time to actually visit Brauschweig
during the last few years, i agree with deleting the example.  If all
you want to do is print the date and time, date(1) is almost certainly
the better tool - because you have made sure that your machine keeps
correct time, right?  Or if you are in the process of fixing the system
time on your machine, then ntpd(8) looks like the better tool.

I hardly see any remaining use case for rdate(8), so an example does
not seem helpful.

If you decide to keep the example, please use

  .Dl foo bar

instead of

  .D1 Li "foo bar"

while there.  As i just discussed with Jason, .Li is almost never
useful, so let's simplify things and get rid of it.  See the "Li"
entry in the mdoc(7) manual.

Yours,
  Ingo


> > Index: rdate.8
> > ===================================================================
> > RCS file: /cvs/src/usr.sbin/rdate/rdate.8,v
> > retrieving revision 1.37
> > diff -u -p -r1.37 rdate.8
> > --- rdate.8 10 Feb 2015 13:10:27 -0000      1.37
> > +++ rdate.8 6 Jan 2019 03:18:48 -0000
> > @@ -93,18 +93,9 @@ Always show the adjustment.
> >  record of date resets and time changes
> >  .El
> >  .Sh EXAMPLES
> > -To get the legal time in Germany, set the
> > -.Pa /etc/localtime
> > -symlink to
> > -.Pa /usr/share/zoneinfo/right/Europe/Berlin
> > -and issue the following command:
> > +To print the legal time in Germany, issue the following command:
> >  .Pp
> > -.D1 Li "# rdate -v ptbtime1.ptb.de"
> > -.Pp
> > -The command of course assumes you have a working internet connection
> > -and DNS set up to connect to the server at
> > -.Sy Physikalisch-Technische Bundesanstalt
> > -in Braunschweig, Germany.
> > +.D1 Li "$ env TZ=right/Europe/Berlin rdate -p pool.ntp.org"
> >  .Sh SEE ALSO
> >  .Xr date 1 ,
> >  .Xr adjtime 2 ,

Reply via email to