From 0f58a72abb7c4a05ef558bc315dcfdc0806b7da6 Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Mon, 18 Aug 2008 14:36:57 +0000 Subject: [PATCH 1/4] Move FREEBSD-Xlist in a more proper location. --- FREEBSD-Xlist | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 FREEBSD-Xlist diff --git a/FREEBSD-Xlist b/FREEBSD-Xlist new file mode 100644 index 000000000000..0313aa098b04 --- /dev/null +++ b/FREEBSD-Xlist @@ -0,0 +1,3 @@ +*ports +*html/pic +*ElectricFence From e1e2a2059117d6d3d69f8d70ec7d52138711719d Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Mon, 18 Aug 2008 14:37:44 +0000 Subject: [PATCH 2/4] Move FREEBSD-upgrade as well. --- FREEBSD-upgrade | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 FREEBSD-upgrade diff --git a/FREEBSD-upgrade b/FREEBSD-upgrade new file mode 100644 index 000000000000..feea46704643 --- /dev/null +++ b/FREEBSD-upgrade @@ -0,0 +1,45 @@ +# ex:ts=8 +# +# $FreeBSD$ + +NTP 4.2.0 + originals can be found on ftp://ftp.udel.edu/pub/ntp/ntp4/ + +For the import of NTP the following files were removed: + + ports/* NT files + html/pic/* GIF files + ElectricFence/* Support for the ElectricFence library + (only useful if you want to debug ntpd) + +The stripped down version was created using FREEBSD-Xlist during extraction: + + tar -X FREEBSD-Xlist -xvzf ntp-4.2.0.tar.gz + mv ntp-4.2.0 ntp + +Imported by: + + cvs import -ko -m 'Virgin import of ntpd 4.2.0' \ + src/contrib/ntp DMILLS v4_2_0 + +./configure --disable-all-clocks --enable-NMEA --enable-ONCORE +--enable-RAWDCF --with-crypto --disable-debugging +--enable-LOCAL-CLOCK --with-sntp --with-arlib --prefix=/usr + +config.h was generated by running configure and excluding almost all clock +drivers (what is included is DCF77 -- what I use --, NMEA, Motorola OnCORE +and local clocks). + +The file is then edited to edit the value of "NO_PARENB_IGNPAR" because we +need to set no parity on the serial port (needed for DCF77). All clock +drivers are then disabled (some of them are included by default by ntpd). + +Note that there are two #ifdef to support other architectures (WRT to long +size and endianness). They'll need to be redone for each upgrade to the +vendor branch to keep config.h in sync. + +ntpd/ntp_control.c is now the only file that is different from the vendor +branch for unsigned char/int fixes and removal of a DoS. + +Documentation in /usr/share/doc/ntp is generated from the HTML files with +lynx (without the GIF files of course). From f1c13ed37419f9172a98c30326ee06364c703b7e Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Mon, 18 Aug 2008 14:41:31 +0000 Subject: [PATCH 3/4] Update instructions with svn usage. --- FREEBSD-upgrade | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/FREEBSD-upgrade b/FREEBSD-upgrade index feea46704643..a2f7d84e368a 100644 --- a/FREEBSD-upgrade +++ b/FREEBSD-upgrade @@ -2,8 +2,11 @@ # # $FreeBSD$ -NTP 4.2.0 - originals can be found on ftp://ftp.udel.edu/pub/ntp/ntp4/ +NTP 4.2.4p5 + originals can be found on http://www.ntp.org/downloads.html + +Import +------ For the import of NTP the following files were removed: @@ -11,16 +14,18 @@ For the import of NTP the following files were removed: html/pic/* GIF files ElectricFence/* Support for the ElectricFence library (only useful if you want to debug ntpd) + html/build/hints/solaris.xtra.4095849 Trigger merge conflict script The stripped down version was created using FREEBSD-Xlist during extraction: - tar -X FREEBSD-Xlist -xvzf ntp-4.2.0.tar.gz - mv ntp-4.2.0 ntp + tar -X FREEBSD-Xlist -xvzf ntp-4.2.4p5.tar.gz + mv ntp-4.2.4p5 4.2.4p5 Imported by: + See procedure on http://wiki.freebsd.org/SubversionPrimer/VendorImports - cvs import -ko -m 'Virgin import of ntpd 4.2.0' \ - src/contrib/ntp DMILLS v4_2_0 +Updating usr.sbin/ntp +--------------------- ./configure --disable-all-clocks --enable-NMEA --enable-ONCORE --enable-RAWDCF --with-crypto --disable-debugging From a3275ecc3f255ee9ae2e95324b0c6f1709699789 Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Sun, 7 Sep 2008 22:08:10 +0000 Subject: [PATCH 4/4] Re-apply patch from bin/92839 to avoid two possible buffer overflows. For an unknown reason, this seems to have never been applied to vendor sources. PR: bin/92839 Submitted by: Helge Oldach --- FREEBSD-upgrade | 3 +++ libparse/clk_rawdcf.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/FREEBSD-upgrade b/FREEBSD-upgrade index a2f7d84e368a..e1e18995e73d 100644 --- a/FREEBSD-upgrade +++ b/FREEBSD-upgrade @@ -48,3 +48,6 @@ branch for unsigned char/int fixes and removal of a DoS. Documentation in /usr/share/doc/ntp is generated from the HTML files with lynx (without the GIF files of course). + +One patch needs to be applied after that to close two buffer overflows. See +bin/92839 for details. diff --git a/libparse/clk_rawdcf.c b/libparse/clk_rawdcf.c index 3ef36c43ea37..3465e8dfbad1 100644 --- a/libparse/clk_rawdcf.c +++ b/libparse/clk_rawdcf.c @@ -229,7 +229,7 @@ convert_rawdcf( unsigned char *c = dcfprm->zerobits; int i; - parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%s\"\n", buffer)); + parseprintf(DD_RAWDCF,("parse: convert_rawdcf: \"%.*s\"\n", size, buffer)); if (size < 57) { @@ -320,7 +320,7 @@ convert_rawdcf( * bad format - not for us */ #ifndef PARSEKERNEL - msyslog(LOG_ERR, "parse: convert_rawdcf: parity check FAILED for \"%s\"\n", buffer); + msyslog(LOG_ERR, "parse: convert_rawdcf: parity check FAILED for \"%.*s\"\n", size, buffer); #endif return CVT_FAIL|CVT_BADFMT; }