OpenBSD CVS

CVS log for src/usr.sbin/ntpd/ntp_dns.c


[BACK] Up to [local] / src / usr.sbin / ntpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.28 / (download) - annotate - [select for diffs], Wed Apr 19 12:58:16 2023 UTC (13 months, 2 weeks ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.27: +1 -4 lines
Diff to previous 1.27 (colored)

remove duplicate includes

Revision 1.27 / (download) - annotate - [select for diffs], Sun Oct 24 21:24:19 2021 UTC (2 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant.  Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk.  They could all be 0xdeafbeef.
ok millert

Revision 1.26 / (download) - annotate - [select for diffs], Sun Apr 12 14:20:56 2020 UTC (4 years, 1 month ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.25: +6 -2 lines
Diff to previous 1.25 (colored)

If all addresses are numeric no use for dns probe; ok florian@ sthen@

Revision 1.25 / (download) - annotate - [select for diffs], Sat Apr 11 07:49:48 2020 UTC (4 years, 1 month ago) by otto
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Zap double definition of conf and make ibuf_dns static to avoid double
definition; from Michael Forney

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jun 27 15:18:42 2019 UTC (4 years, 11 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored)

Allow logging to both stderr and syslog; don't reset the log level if
the log destination changes. ok claudio@ benno@

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jun 20 07:28:18 2019 UTC (4 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.22: +47 -1 lines
Diff to previous 1.22 (colored)

Do a quick DNS probe to decide to stay in the forground and attempt
an (auto) settime or give up. 15s timeout is still in effect. ok florian@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jun 12 05:04:45 2019 UTC (4 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.21: +16 -11 lines
Diff to previous 1.21 (colored)

Fix init of syslog for childs and teach dns process about synced state.
ok benno@

Revision 1.21 / (download) - annotate - [select for diffs], Tue May 28 06:49:46 2019 UTC (5 years ago) by otto
Branch: MAIN
Changes since 1.20: +13 -3 lines
Diff to previous 1.20 (colored)

A step in solving the bootstrap problem in a dnssec environement.
If the time is wrong, we cannot validate dnssec, leading to failed
DNS lookups, so we cannot adjust or set the time.  Work around this
by repeating a failed DNS lookup with a lookup with the DC (check
disabled) bit set. ok florian@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Apr 17 16:03:15 2017 UTC (7 years, 1 month ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.19: +5 -4 lines
Diff to previous 1.19 (colored)

don't manipulate hdr.len, it's used internally by libutil now; ok florian@

Revision 1.19 / (download) - annotate - [select for diffs], Mon Sep 26 16:55:02 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.18: +2 -7 lines
Diff to previous 1.18 (colored)

Teach ntpd(8) how to use socket status to shutdown the daemon. While at
it, remove some verbose shutdown messages that we had before with pipe
close.

ok reyk@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Sep 14 13:20:16 2016 UTC (7 years, 8 months ago) by rzalamena
Branch: MAIN
Changes since 1.17: +5 -18 lines
Diff to previous 1.17 (colored)

Teach ntpd(8) how to fork+exec.

ok reyk@, bcook@

Revision 1.17 / (download) - annotate - [select for diffs], Sat Sep 3 11:52:06 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (colored)

Remove the oh so funny "LOSS OF MIND" from the diclaimer that was not
part of the original ISC license that we use in OpenBSD.  Done for
files were Henning is the original author.

OK henning@ deraadt@

Revision 1.16 / (download) - annotate - [select for diffs], Sat Dec 19 17:55:29 2015 UTC (8 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.15: +6 -3 lines
Diff to previous 1.15 (colored)

Switch and sync to the log.c variant from httpd/relayd/iked/snmpd/vmd.

OK bcook@ jung@

Revision 1.15 / (download) - annotate - [select for diffs], Sat Dec 5 13:12:16 2015 UTC (8 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

EAGAIN handling for imsg_read. OK henning@ benno@

Revision 1.14 / (download) - annotate - [select for diffs], Sun Oct 25 10:52:48 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.13: +13 -2 lines
Diff to previous 1.13 (colored)

the DNS process was not discarding & redirecting stdin/out/err to
/dev/null.  copy the code from the ntp engine.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Oct 10 20:10:14 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

pledge "dns rw" is not a reliable pattern.  This means malloc() and other
types of functions (perhaps required by 'stdio' or 'libevent' will not
become available unless DNS suceeds.  Replace it with "stdio dns".

Revision 1.12 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:09 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.11 / (download) - annotate - [select for diffs], Sat Oct 3 02:48:54 2015 UTC (8 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +4 -1 lines
Diff to previous 1.10 (colored)

the ntp dns process only needs tame "dns rw" to operate.  at least,
that's the case after kernel code got fixed to handle inet6 for dns...

Revision 1.10 / (download) - annotate - [select for diffs], Tue Mar 24 18:25:27 2015 UTC (9 years, 2 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

instead of routing SIGHUP thru sighdlr_dns() which then ignores it,
ignore it directly. no functional change. Rafael Neves rafaelneves at gmail

Revision 1.9 / (download) - annotate - [select for diffs], Thu Feb 12 01:54:57 2015 UTC (9 years, 3 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.8: +10 -4 lines
Diff to previous 1.8 (colored)

Use ntpd's deferred DNS resolving for constraints as well.  This
allows to get constraint addresses even if network/DNS is not
available at startup (or system boot).

thumbs up & OK henning@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jan 21 03:14:10 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Fix deferred host DNS lookups.

If the network is unreachable when ntpd starts and host_dns fails, be sure
that we still close the HOST_DNS imsg.

Thanks to Paul de Weerd <weerd at weirdnet dot nl> for reporting this.

ok beck@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jan 13 02:28:56 2015 UTC (9 years, 4 months ago) by bcook
Branch: MAIN
Changes since 1.6: +15 -8 lines
Diff to previous 1.6 (colored)

fix some memory leaks in dns handling.

 - Nothing seems to free the result of host_dns(), so add host_dns_free() and
   call after each query.
 - If imsg_add() fails, it frees buf. Avoid subsequently dereferencing the
   freed buf in imsg_close().

ok millert@ deraadt@

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jan 9 07:35:37 2015 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

remove excessive/wrong use of sys/param.h
peanuts -- but all work has to start somewhere.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Feb 10 09:12:34 2014 UTC (10 years, 3 months ago) by dtucker
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.4: +7 -1 lines
Diff to previous 1.4 (colored)

Run the serving and privileged ntpd processes at high priority and the
dns process at normal priority.  Should improve latency on loaded machines.
ok henning@

Revision 1.4 / (download) - annotate - [select for diffs], Wed Nov 13 20:44:39 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.3: +3 -2 lines
Diff to previous 1.3 (colored)

from sthen: handle msgbuf_write() returning EAGAIN

ok krw

Revision 1.3 / (download) - annotate - [select for diffs], Wed May 26 13:56:08 2010 UTC (14 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE.

ok henning gilles claudio jacekm deraadt

Revision 1.2 / (download) - annotate - [select for diffs], Tue Feb 10 16:41:39 2009 UTC (15 years, 4 months ago) by stevesk
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.1: +1 -2 lines
Diff to previous 1.1 (colored)

endservent() not needed here; ok henning@

Revision 1.1 / (download) - annotate - [select for diffs], Fri Sep 12 10:46:09 2008 UTC (15 years, 8 months ago) by henning
Branch: MAIN

move dns lookups to its own (privilege revoking, not chrooting) process.
reason: the parent process must never ever block, but the dns routines can.
last not least this fixes ntpd -s 'hanging' for a long time.
tested by a couple of people

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.