summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ntp/ntp_4.2.8p6.bb
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2016-01-29 12:14:26 -0800
committerJoe MacDonald <joe_macdonald@mentor.com>2016-02-22 15:51:19 -0500
commit1ddc9a5e653d0869df5fd9ccf16128cee88008c6 (patch)
tree057425d269aa05823f6527dc98aad0ea79efe633 /meta-networking/recipes-support/ntp/ntp_4.2.8p6.bb
parentbb7fafbc7c8756f5905bc1ae65242a308ad9e23a (diff)
downloadmeta-openembedded-1ddc9a5e653d0869df5fd9ccf16128cee88008c6.tar.gz
ntp: update 4.2.8p6
QA error fix: ERROR: QA Issue: ntp: Files/directories were installed but not shipped in any package: /usr/libexec CVES addressed: Bug 2948 / CVE-2015-8158 Bug 2945 / CVE-2015-8138: origin: Zero Origin Timestamp Bypass Bug 2942 / CVE-2015-7979: Off-path Denial of Service (DoS) attack on authenticated broadcast mode Bug 2940 / CVE-2015-7978: Stack exhaustion in recursive traversal of restriction list Bug 2939 / CVE-2015-7977: reslist NULL pointer dereference Bug 2938 / CVE-2015-7976: ntpq saveconfig command allows dangerous characters in filenames Bug 2937 / CVE-2015-7975: nextvar() missing length check Bug 2936 / CVE-2015-7974: Skeleton Key: Missing key check allows impersonation between authenticated peers Bug 2935 / CVE-2015-7973: Deja Vu: Replay attack on authenticated broadcast mode Bug 2947 / CVE-2015-8140: ntpq vulnerable to replay attacks Bug 2946 / CVE-2015-8139: Origin Leak: ntpq and ntpdc, disclose origin NTP-4.2.8p5 NtpBug2956: Small-step/Big-step CVE-2015-5300 Bug #2829 Clean up pipe_fds in ntpd.c Bug #2887 stratum -1 config results as showing value 99. Bug #2932 Update leapsecond file info in miscopt.html. Bug #2934 tests/ntpd/t-ntp_scanner.c has a magic constant wired in. Bug #2944 errno is not preserved properly in ntpdate after sendto call. Bug #2952 peer associations were broken by the fix for NtpBug2901 CVE-2015-7704 Bug #2954 Version 4.2.8p4 crashes on startup on some OSes. Bug #2957 'unsigned int' vs 'size_t' format clash. Bug #2958 ntpq: fatal error messages need a final newline. Bug #2962 truncation of size_t/ptrdiff_t on 64bit targets. Bug #2965 Local clock didn't work since 4.2.8p4. Bug #2967 ntpdate command suffers an assertion failure Bug #2969 Seg fault from ntpq/mrulist when looking at server with lots of clients. Bug #2971 ntpq bails on ^C: select fails: Interrupted system call Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-support/ntp/ntp_4.2.8p6.bb')
-rw-r--r--meta-networking/recipes-support/ntp/ntp_4.2.8p6.bb157
1 files changed, 157 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p6.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p6.bb
new file mode 100644
index 000000000..1836dd9bc
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p6.bb
@@ -0,0 +1,157 @@
1SUMMARY = "Network Time Protocol daemon and utilities"
2DESCRIPTION = "The Network Time Protocol (NTP) is used to \
3synchronize the time of a computer client or server to \
4another server or reference time source, such as a radio \
5or satellite receiver or modem."
6HOMEPAGE = "http://support.ntp.org"
7SECTION = "net"
8LICENSE = "NTP"
9LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=f41fedb22dffefcbfafecc85b0f79cfa"
10
11DEPENDS = "libevent"
12
13SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
14 file://ntp-4.2.4_p6-nano.patch \
15 file://ntpd \
16 file://ntp.conf \
17 file://ntpdate \
18 file://ntpdate.default \
19 file://ntpdate.service \
20 file://ntpd.service \
21 file://sntp.service \
22 file://sntp \
23 file://ntpd.list \
24"
25
26SRC_URI[md5sum] = "60049f51e9c8305afe30eb22b711c5c6"
27SRC_URI[sha256sum] = "583d0e1c573ace30a9c6afbea0fc52cae9c8c916dbc15c026e485a0dda4ba048"
28
29inherit autotools update-rc.d useradd systemd pkgconfig
30
31# The ac_cv_header_readline_history is to stop ntpdc depending on either
32# readline or curses
33EXTRA_OECONF += "--with-net-snmp-config=no \
34 --without-ntpsnmpd \
35 ac_cv_header_readline_history_h=no \
36 --with-yielding_select=yes \
37 --with-locfile=redhat \
38 --without-rpath \
39 "
40CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
41
42USERADD_PACKAGES = "${PN}"
43NTP_USER_HOME ?= "/var/lib/ntp"
44USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \
45 --no-create-home \
46 --shell /bin/false --user-group ntp"
47
48# NB: debug is default-enabled by NTP; keep it default-enabled here.
49PACKAGECONFIG ??= "cap debug refclocks"
50PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
51 --with-openssl-incdir=${STAGING_INCDIR} \
52 --with-crypto, \
53 --without-openssl --without-crypto, \
54 openssl"
55PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap"
56PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline"
57PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools"
58PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging"
59
60do_install_append() {
61 install -d ${D}${sysconfdir}/init.d
62 install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
63 install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d
64 install -d ${D}${bindir}
65 install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync
66
67 install -m 755 -d ${D}${NTP_USER_HOME}
68 chown ntp:ntp ${D}${NTP_USER_HOME}
69
70 # Fix hardcoded paths in scripts
71 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
72 sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
73 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
74 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
75 sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync
76 sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace
77 sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace
78 sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait
79 sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait
80 sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj
81 sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj
82
83 install -d ${D}/${sysconfdir}/default
84 install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate
85 install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
86
87 install -d ${D}/${sysconfdir}/network/if-up.d
88 ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
89
90 install -d ${D}${systemd_unitdir}/system
91 install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
92 install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
93 install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/
94
95 install -d ${D}${systemd_unitdir}/ntp-units.d
96 install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list
97}
98
99PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils"
100# NOTE: you don't need ntpdate, use "ntpd -q -g -x"
101
102# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
103# with wonky clocks (e.g. OpenSlug)
104RDEPENDS_${PN} = "${PN}-tickadj"
105# Handle move from bin to utils package
106RPROVIDES_${PN}-utils = "${PN}-bin"
107RREPLACES_${PN}-utils = "${PN}-bin"
108RCONFLICTS_${PN}-utils = "${PN}-bin"
109
110SYSTEMD_PACKAGES = "${PN} ntpdate sntp"
111SYSTEMD_SERVICE_${PN} = "ntpd.service"
112SYSTEMD_SERVICE_ntpdate = "ntpdate.service"
113SYSTEMD_SERVICE_sntp = "sntp.service"
114
115RPROVIDES_${PN} += "${PN}-systemd"
116RREPLACES_${PN} += "${PN}-systemd"
117RCONFLICTS_${PN} += "${PN}-systemd"
118
119RPROVIDES_ntpdate += "ntpdate-systemd"
120RREPLACES_ntpdate += "ntpdate-systemd"
121RCONFLICTS_ntpdate += "ntpdate-systemd"
122
123RSUGGESTS_${PN} = "iana-etc"
124
125FILES_${PN} = "${sbindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \
126 ${NTP_USER_HOME} \
127 ${systemd_unitdir}/ntp-units.d/60-ntpd.list ${libexecdir}\
128"
129FILES_${PN}-tickadj = "${sbindir}/tickadj"
130FILES_${PN}-utils = "${sbindir} ${datadir}/ntp/lib"
131RDEPENDS_${PN}-utils += "perl"
132FILES_ntpdate = "${sbindir}/ntpdate \
133 ${sysconfdir}/network/if-up.d/ntpdate-sync \
134 ${bindir}/ntpdate-sync \
135 ${sysconfdir}/default/ntpdate \
136 ${systemd_unitdir}/system/ntpdate.service \
137"
138FILES_sntp = "${sbindir}/sntp \
139 ${sysconfdir}/default/sntp \
140 ${systemd_unitdir}/system/sntp.service \
141 "
142
143CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
144CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate"
145
146INITSCRIPT_NAME = "ntpd"
147# No dependencies, so just go in at the standard level (20)
148INITSCRIPT_PARAMS = "defaults"
149
150pkg_postinst_ntpdate() {
151 if ! grep -q -s ntpdate $D/var/spool/cron/root; then
152 echo "adding crontab"
153 test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron
154 echo "30 * * * * ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root
155 fi
156}
157