* [PATCH v3 02/11] wic: use partition size when creating empty partition files
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
It seems that prepare_empty_partition_ext() and
prepare_empty_partition_btrfs() got broken in commit
c8669749e37fe865c197c98d5671d9de176ff4dd, thus one could observe the
following backtrace:
Backtrace:
File "<snip>/poky/scripts/lib/wic/plugins/imager/direct_plugin.py", line 93, in do_create
creator.create()
File "<snip>/poky/scripts/lib/wic/imager/baseimager.py", line 159, in create
self._create()
File "<snip>/poky/scripts/lib/wic/imager/direct.py", line 290, in _create
self.bootimg_dir, self.kernel_dir, self.native_sysroot)
File "<snip>/poky/scripts/lib/wic/partition.py", line 146, in prepare
method(rootfs, oe_builddir, native_sysroot)
File "<snip>/poky/scripts/lib/wic/partition.py", line 325, in prepare_empty_partition_ext
os.ftruncate(sparse.fileno(), rootfs_size * 1024)
NameError: name 'rootfs_size' is not defined
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/lib/wic/partition.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 959035a97110244ffe56e95a886e122c400d4779..f3835339afc5091604ffd7f0d0acf1d1ad4351cc 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -314,7 +314,7 @@ class Partition():
Prepare an empty ext2/3/4 partition.
"""
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), rootfs_size * 1024)
+ os.ftruncate(sparse.fileno(), self.size * 1024)
extra_imagecmd = "-i 8192"
@@ -332,7 +332,7 @@ class Partition():
Prepare an empty btrfs partition.
"""
with open(rootfs, 'w') as sparse:
- os.ftruncate(sparse.fileno(), rootfs_size * 1024)
+ os.ftruncate(sparse.fileno(), self.size * 1024)
label_str = ""
if self.label:
--
2.5.0
^ permalink raw reply related
* [PATCH v3 01/11] wic: make sure that partition size is always an integer in internal processing
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
In-Reply-To: <cover.1479203195.git.maciej.borzecki@rndity.com>
The size field of Partition class is expected to be an integer and ought
to be set inside prepare_*() method. Make sure that this is always the
case.
Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
---
scripts/lib/wic/partition.py | 12 +++++++++---
scripts/lib/wic/plugins/source/bootimg-efi.py | 2 +-
scripts/lib/wic/plugins/source/rawcopy.py | 4 ++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index 89c33ab8b7d54bb14678b2e07e706e3feb6ae57a..959035a97110244ffe56e95a886e122c400d4779 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -146,6 +146,12 @@ class Partition():
oe_builddir,
bootimg_dir, kernel_dir, rootfs_dir,
native_sysroot)
+ # further processing required Partition.size to be an integer, make
+ # sure that it is one
+ if type(self.size) is not int:
+ msger.error("Partition %s internal size is not an integer. " \
+ "This a bug in source plugin %s and needs to be fixed." \
+ % (self.mountpoint, self.source))
def prepare_rootfs_from_fs_image(self, cr_workdir, oe_builddir,
rootfs_dir):
@@ -157,7 +163,7 @@ class Partition():
out = exec_cmd(du_cmd)
rootfs_size = out.split()[0]
- self.size = rootfs_size
+ self.size = int(rootfs_size)
self.source_file = rootfs
def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir,
@@ -194,7 +200,7 @@ class Partition():
# get the rootfs size in the right units for kickstart (kB)
du_cmd = "du -Lbks %s" % rootfs
out = exec_cmd(du_cmd)
- self.size = out.split()[0]
+ self.size = int(out.split()[0])
break
@@ -379,7 +385,7 @@ class Partition():
out = exec_cmd(du_cmd)
fs_size = out.split()[0]
- self.size = fs_size
+ self.size = int(fs_size)
def prepare_swap_partition(self, cr_workdir, oe_builddir, native_sysroot):
"""
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 8bc362254d8c06511aa2cf0d5e1bf6f5aa93804b..4adb80becc11a6d30ffeae64ff87ebeb959dde86 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -234,5 +234,5 @@ class BootimgEFIPlugin(SourcePlugin):
out = exec_cmd(du_cmd)
bootimg_size = out.split()[0]
- part.size = bootimg_size
+ part.size = int(bootimg_size)
part.source_file = bootimg
diff --git a/scripts/lib/wic/plugins/source/rawcopy.py b/scripts/lib/wic/plugins/source/rawcopy.py
index e0b11f95adb5a2c55fdc3b5e3ff1f4b463e2be9d..5bd22fdeb55bc2f0b38ffcc2a46cf18ade5425ef 100644
--- a/scripts/lib/wic/plugins/source/rawcopy.py
+++ b/scripts/lib/wic/plugins/source/rawcopy.py
@@ -78,9 +78,9 @@ class RawCopyPlugin(SourcePlugin):
# get the size in the right units for kickstart (kB)
du_cmd = "du -Lbks %s" % dst
out = exec_cmd(du_cmd)
- filesize = out.split()[0]
+ filesize = int(out.split()[0])
- if int(filesize) > int(part.size):
+ if filesize > part.size:
part.size = filesize
part.source_file = dst
--
2.5.0
^ permalink raw reply related
* [PATCH v3 00/11] wic: bugfixes & --fixed-size support, tests, oe-selftest: minor fixes
From: Maciej Borzecki @ 2016-11-15 9:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Paul Eggleton, Maciej Borzecki
v3 of patch series previously posted here [1].
I have noticed that Ross has cherry-picked some patches into his
pull request to master. Just for reference, the patches are included in this
series, but have not been changed since the previous version. The
patches in question are:
oe-selftest: fix handling of test cases without ID in --list-tests-by
wic: make sure that partition size is always an integer in internal
processing
wic: use partition size when creating empty partition files
wic: check that filesystem is specified for a rootfs partition
wic: fix function comment typos
wic: add --fixed-size wks option
Changes since v2:
* COMPATIBLE_HOST workarounds now selectively skip certain wic tests for
archs that cannot build images included in the test (most commonly
directdisk-* image is not usable on non x86 archs), wic tests were
verified to pass for qemux86-64 and beaglebone
* oe-selftest enforces en_US.UTF-8 encoding to enforce stable textual
output of locaization aware programs
[1]. http://lists.openembedded.org/pipermail/openembedded-core/2016-November/128630.html
Maciej Borzecki (11):
wic: make sure that partition size is always an integer in internal
processing
wic: use partition size when creating empty partition files
wic: check that filesystem is specified for a rootfs partition
wic: fix function comment typos
wic: add --fixed-size wks option
wic: selftest: avoid COMPATIBLE_HOST issues
wic: selftest: do not repeat core-image-minimal
wic: selftest: do not assume bzImage kernel image
wic: selftest: add tests for --fixed-size partition flags
oe-selftest: fix handling of test cases without ID in --list-tests-by
oe-selftest: enforce en_US.UTF-8 locale
meta/lib/oeqa/selftest/wic.py | 230 +++++++++++++++++++++-----
scripts/lib/wic/help.py | 14 +-
scripts/lib/wic/imager/direct.py | 2 +-
scripts/lib/wic/ksparser.py | 41 ++++-
scripts/lib/wic/partition.py | 104 ++++++++----
scripts/lib/wic/plugins/source/bootimg-efi.py | 2 +-
scripts/lib/wic/plugins/source/rawcopy.py | 4 +-
scripts/lib/wic/utils/partitionedfs.py | 6 +-
scripts/oe-selftest | 16 +-
9 files changed, 322 insertions(+), 97 deletions(-)
--
2.5.0
^ permalink raw reply
* [PATCH] xinput-calibrator: use up-to-date git version
From: Diego Rondini @ 2016-11-15 9:39 UTC (permalink / raw)
To: openembedded-core; +Cc: Diego Rondini
Use up-to-date version from git. While currently there aren't official releases
newer than 0.7.5, quite some new features have been added in git, for example
the ability to disable the calibration screen timeout.
Signed-off-by: Diego Rondini <diego.ml@zoho.com>
---
meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
index 57c3a7a..791895a 100644
--- a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
+++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
@@ -5,13 +5,13 @@ LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=1bcba08f67cdb56f340
DEPENDS = "virtual/libx11 libxi"
PV = "0.7.5+git${SRCPV}"
-PR = "r6"
+PR = "r7"
inherit autotools pkgconfig distro_features_check
# depends on virtual/libx11
REQUIRED_DISTRO_FEATURES = "x11"
-SRCREV = "c01c5af807cb4b0157b882ab07a893df9a810111"
+SRCREV = "03dadf55109bd43d3380f040debe9f82f66f2f35"
SRC_URI = "git://github.com/tias/xinput_calibrator.git \
file://30xinput_calibrate.sh \
file://Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch \
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 10/11] curl: CVE-2016-8624
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
invalid URL parsing with '#'
Affected versions: curl 7.1 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102J.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8624.patch | 51 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 52 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8624.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8624.patch b/meta/recipes-support/curl/curl/CVE-2016-8624.patch
new file mode 100644
index 0000000..009f7d0
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8624.patch
@@ -0,0 +1,51 @@
+From 3bb273db7e40ebc284cff45f3ce3f0475c8339c2 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 11 Oct 2016 00:48:35 +0200
+Subject: [PATCH] urlparse: accept '#' as end of host name
+
+'http://example.com#@127.0.0.1/x.txt' equals a request to example.com
+for the '/' document with the rest of the URL being a fragment.
+
+CVE: CVE-2016-8624
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102J.html
+Reported-by: Fernando Muñoz
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+
+diff -ruN a/lib/url.c b/lib/url.c
+--- a/lib/url.c 2016-11-07 08:50:23.030126833 +0100
++++ b/lib/url.c 2016-11-07 10:16:13.562089428 +0100
+@@ -4086,7 +4086,7 @@
+ path[0]=0;
+
+ if(2 > sscanf(data->change.url,
+- "%15[^\n:]://%[^\n/?]%[^\n]",
++ "%15[^\n:]://%[^\n/?#]%[^\n]",
+ protobuf,
+ conn->host.name, path)) {
+
+@@ -4094,7 +4094,7 @@
+ * The URL was badly formatted, let's try the browser-style _without_
+ * protocol specified like 'http://'.
+ */
+- rc = sscanf(data->change.url, "%[^\n/?]%[^\n]", conn->host.name, path);
++ rc = sscanf(data->change.url, "%[^\n/?#]%[^\n]", conn->host.name, path);
+ if(1 > rc) {
+ /*
+ * We couldn't even get this format.
+@@ -4184,10 +4184,10 @@
+ }
+
+ /* If the URL is malformatted (missing a '/' after hostname before path) we
+- * insert a slash here. The only letter except '/' we accept to start a path
+- * is '?'.
++ * insert a slash here. The only letters except '/' that can start a path is
++ * '?' and '#' - as controlled by the two sscanf() patterns above.
+ */
+- if(path[0] == '?') {
++ if(path[0] != '/') {
+ /* We need this function to deal with overlapping memory areas. We know
+ that the memory area 'path' points to is 'urllen' bytes big and that
+ is bigger than the path. Use +1 to move the zero byte too. */
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 0f8fa3a..3c877e4 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -24,6 +24,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8621.patch \
file://CVE-2016-8622.patch \
file://CVE-2016-8623.patch \
+ file://CVE-2016-8624.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 11/11] curl: CVE-2016-8625
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
IDNA 2003 makes curl use wrong host
Affected versions: curl 7.12.0 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102K.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8625.patch | 615 +++++++++++++++++++++
.../url-remove-unconditional-idn2.h-include.patch | 29 +
meta/recipes-support/curl/curl_7.47.1.bb | 2 +
3 files changed, 646 insertions(+)
create mode 100755 meta/recipes-support/curl/curl/CVE-2016-8625.patch
create mode 100644 meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8625.patch b/meta/recipes-support/curl/curl/CVE-2016-8625.patch
new file mode 100755
index 0000000..b618277
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8625.patch
@@ -0,0 +1,615 @@
+commit 914aae739463ec72340130ea9ad42e04b02a5338
+Author: Daniel Stenberg <daniel@haxx.se>
+Date: Wed Oct 12 09:01:06 2016 +0200
+
+idn: switch to libidn2 use and IDNA2008 support
+
+CVE: CVE-2016-8625
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102K.html
+Reported-by: Christian Heimes
+
+Conflicts:
+ CMakeLists.txt
+ lib/url.c
+
+Signed-off-by: Martin Borg <martin.borg@enea.com>
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 06f18cf..c3e5c7c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -440,7 +440,7 @@ if(NOT CURL_DISABLE_LDAPS)
+ endif()
+
+ # Check for idn
+-check_library_exists_concat("idn" idna_to_ascii_lz HAVE_LIBIDN)
++check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2)
+
+ # Check for symbol dlopen (same as HAVE_LIBDL)
+ check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
+@@ -608,7 +608,7 @@ check_include_file_concat("des.h" HAVE_DES_H)
+ check_include_file_concat("err.h" HAVE_ERR_H)
+ check_include_file_concat("errno.h" HAVE_ERRNO_H)
+ check_include_file_concat("fcntl.h" HAVE_FCNTL_H)
+-check_include_file_concat("idn-free.h" HAVE_IDN_FREE_H)
++check_include_file_concat("idn2.h" HAVE_IDN2_H)
+ check_include_file_concat("ifaddrs.h" HAVE_IFADDRS_H)
+ check_include_file_concat("io.h" HAVE_IO_H)
+ check_include_file_concat("krb.h" HAVE_KRB_H)
+@@ -638,7 +638,6 @@ check_include_file_concat("stropts.h" HAVE_STROPTS_H)
+ check_include_file_concat("termio.h" HAVE_TERMIO_H)
+ check_include_file_concat("termios.h" HAVE_TERMIOS_H)
+ check_include_file_concat("time.h" HAVE_TIME_H)
+-check_include_file_concat("tld.h" HAVE_TLD_H)
+ check_include_file_concat("unistd.h" HAVE_UNISTD_H)
+ check_include_file_concat("utime.h" HAVE_UTIME_H)
+ check_include_file_concat("x509.h" HAVE_X509_H)
+@@ -652,9 +651,6 @@ check_include_file_concat("netinet/if_ether.h" HAVE_NETINET_IF_ETHER_H)
+ check_include_file_concat("stdint.h" HAVE_STDINT_H)
+ check_include_file_concat("sockio.h" HAVE_SOCKIO_H)
+ check_include_file_concat("sys/utsname.h" HAVE_SYS_UTSNAME_H)
+-check_include_file_concat("idna.h" HAVE_IDNA_H)
+-
+-
+
+ check_type_size(size_t SIZEOF_SIZE_T)
+ check_type_size(ssize_t SIZEOF_SSIZE_T)
+@@ -802,9 +798,6 @@ check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE)
+ check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE)
+ check_symbol_exists(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME)
+ check_symbol_exists(getrlimit "${CURL_INCLUDES}" HAVE_GETRLIMIT)
+-check_symbol_exists(idn_free "${CURL_INCLUDES}" HAVE_IDN_FREE)
+-check_symbol_exists(idna_strerror "${CURL_INCLUDES}" HAVE_IDNA_STRERROR)
+-check_symbol_exists(tld_strerror "${CURL_INCLUDES}" HAVE_TLD_STRERROR)
+ check_symbol_exists(setlocale "${CURL_INCLUDES}" HAVE_SETLOCALE)
+ check_symbol_exists(setrlimit "${CURL_INCLUDES}" HAVE_SETRLIMIT)
+ check_symbol_exists(fcntl "${CURL_INCLUDES}" HAVE_FCNTL)
+@@ -1067,7 +1060,7 @@ _add_if("IPv6" ENABLE_IPV6)
+ _add_if("unix-sockets" USE_UNIX_SOCKETS)
+ _add_if("libz" HAVE_LIBZ)
+ _add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX)
+-_add_if("IDN" HAVE_LIBIDN)
++_add_if("IDN" HAVE_LIBIDN2)
+ # TODO SSP1 (WinSSL) check is missing
+ _add_if("SSPI" USE_WINDOWS_SSPI)
+ _add_if("GSS-API" HAVE_GSSAPI)
+diff --git a/configure.ac b/configure.ac
+index 4c9862f..c8e2721 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -157,7 +157,7 @@ curl_tls_srp_msg="no (--enable-tls-srp)"
+ curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
+ curl_ipv6_msg="no (--enable-ipv6)"
+ curl_unix_sockets_msg="no (--enable-unix-sockets)"
+- curl_idn_msg="no (--with-{libidn,winidn})"
++ curl_idn_msg="no (--with-{libidn2,winidn})"
+ curl_manual_msg="no (--enable-manual)"
+ curl_libcurl_msg="enabled (--disable-libcurl-option)"
+ curl_verbose_msg="enabled (--disable-verbose)"
+@@ -2825,15 +2825,15 @@ dnl **********************************************************************
+ dnl Check for the presence of IDN libraries and headers
+ dnl **********************************************************************
+
+-AC_MSG_CHECKING([whether to build with libidn])
++AC_MSG_CHECKING([whether to build with libidn2])
+ OPT_IDN="default"
+ AC_ARG_WITH(libidn,
+-AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
+-AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
++AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
++AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
+ [OPT_IDN=$withval])
+ case "$OPT_IDN" in
+ no)
+- dnl --without-libidn option used
++ dnl --without-libidn2 option used
+ want_idn="no"
+ AC_MSG_RESULT([no])
+ ;;
+@@ -2844,13 +2844,13 @@ case "$OPT_IDN" in
+ AC_MSG_RESULT([(assumed) yes])
+ ;;
+ yes)
+- dnl --with-libidn option used without path
++ dnl --with-libidn2 option used without path
+ want_idn="yes"
+ want_idn_path="default"
+ AC_MSG_RESULT([yes])
+ ;;
+ *)
+- dnl --with-libidn option used with path
++ dnl --with-libidn2 option used with path
+ want_idn="yes"
+ want_idn_path="$withval"
+ AC_MSG_RESULT([yes ($withval)])
+@@ -2867,33 +2867,33 @@ if test "$want_idn" = "yes"; then
+ if test "$want_idn_path" != "default"; then
+ dnl path has been specified
+ IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
+- CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR])
++ CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
+ if test "$PKGCONFIG" != "no"; then
+ IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+- $PKGCONFIG --libs-only-l libidn 2>/dev/null`
++ $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
+ IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+- $PKGCONFIG --libs-only-L libidn 2>/dev/null`
++ $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
+ IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
+- $PKGCONFIG --cflags-only-I libidn 2>/dev/null`
++ $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
+ IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+ else
+ dnl pkg-config not available or provides no info
+- IDN_LIBS="-lidn"
++ IDN_LIBS="-lidn2"
+ IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
+ IDN_CPPFLAGS="-I$want_idn_path/include"
+ IDN_DIR="$want_idn_path/lib$libsuff"
+ fi
+ else
+ dnl path not specified
+- CURL_CHECK_PKGCONFIG(libidn)
++ CURL_CHECK_PKGCONFIG(libidn2)
+ if test "$PKGCONFIG" != "no"; then
+- IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null`
+- IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null`
+- IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
++ IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
++ IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
++ IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
+ IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
+ else
+ dnl pkg-config not available or provides no info
+- IDN_LIBS="-lidn"
++ IDN_LIBS="-lidn2"
+ fi
+ fi
+ #
+@@ -2913,9 +2913,9 @@ if test "$want_idn" = "yes"; then
+ LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
+ LIBS="$IDN_LIBS $LIBS"
+ #
+- AC_MSG_CHECKING([if idna_to_ascii_4i can be linked])
++ AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
+ AC_LINK_IFELSE([
+- AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i])
++ AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
+ ],[
+ AC_MSG_RESULT([yes])
+ tst_links_libidn="yes"
+@@ -2923,37 +2923,19 @@ if test "$want_idn" = "yes"; then
+ AC_MSG_RESULT([no])
+ tst_links_libidn="no"
+ ])
+- if test "$tst_links_libidn" = "no"; then
+- AC_MSG_CHECKING([if idna_to_ascii_lz can be linked])
+- AC_LINK_IFELSE([
+- AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz])
+- ],[
+- AC_MSG_RESULT([yes])
+- tst_links_libidn="yes"
+- ],[
+- AC_MSG_RESULT([no])
+- tst_links_libidn="no"
+- ])
+- fi
+ #
++ AC_CHECK_HEADERS( idn2.h )
++
+ if test "$tst_links_libidn" = "yes"; then
+- AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).])
++ AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
+ dnl different versions of libidn have different setups of these:
+- AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror )
+- AC_CHECK_HEADERS( idn-free.h tld.h )
+- if test "x$ac_cv_header_tld_h" = "xyes"; then
+- AC_SUBST([IDN_ENABLED], [1])
+- curl_idn_msg="enabled"
+- if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
+- LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
+- export LD_LIBRARY_PATH
+- AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
+- fi
+- else
+- AC_MSG_WARN([Libraries for IDN support too old: IDN disabled])
+- CPPFLAGS="$clean_CPPFLAGS"
+- LDFLAGS="$clean_LDFLAGS"
+- LIBS="$clean_LIBS"
++
++ AC_SUBST([IDN_ENABLED], [1])
++ curl_idn_msg="enabled (libidn2)"
++ if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
++ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
++ export LD_LIBRARY_PATH
++ AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
+ fi
+ else
+ AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
+diff --git a/lib/curl_setup.h b/lib/curl_setup.h
+index 33ad129..5fb241b 100644
+--- a/lib/curl_setup.h
++++ b/lib/curl_setup.h
+@@ -590,10 +590,9 @@ int netware_init(void);
+ #endif
+ #endif
+
+-#if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H)
+-/* The lib was present and the tld.h header (which is missing in libidn 0.3.X
+- but we only work with libidn 0.4.1 or later) */
+-#define USE_LIBIDN
++#if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H)
++/* The lib and header are present */
++#define USE_LIBIDN2
+ #endif
+
+ #ifndef SIZEOF_TIME_T
+diff --git a/lib/easy.c b/lib/easy.c
+index d529da8..51d57e3 100644
+--- a/lib/easy.c
++++ b/lib/easy.c
+@@ -144,28 +144,6 @@ static CURLcode win32_init(void)
+ return CURLE_OK;
+ }
+
+-#ifdef USE_LIBIDN
+-/*
+- * Initialise use of IDNA library.
+- * It falls back to ASCII if $CHARSET isn't defined. This doesn't work for
+- * idna_to_ascii_lz().
+- */
+-static void idna_init (void)
+-{
+-#ifdef WIN32
+- char buf[60];
+- UINT cp = GetACP();
+-
+- if(!getenv("CHARSET") && cp > 0) {
+- snprintf(buf, sizeof(buf), "CHARSET=cp%u", cp);
+- putenv(buf);
+- }
+-#else
+- /* to do? */
+-#endif
+-}
+-#endif /* USE_LIBIDN */
+-
+ /* true globals -- for curl_global_init() and curl_global_cleanup() */
+ static unsigned int initialized;
+ static long init_flags;
+@@ -262,10 +240,6 @@ static CURLcode global_init(long flags, bool memoryfuncs)
+ }
+ #endif
+
+-#ifdef USE_LIBIDN
+- idna_init();
+-#endif
+-
+ if(Curl_resolver_global_init()) {
+ DEBUGF(fprintf(stderr, "Error: resolver_global_init failed\n"));
+ return CURLE_FAILED_INIT;
+diff --git a/lib/strerror.c b/lib/strerror.c
+index d222a1f..bf4faae 100644
+--- a/lib/strerror.c
++++ b/lib/strerror.c
+@@ -35,8 +35,8 @@
+
+ #include <curl/curl.h>
+
+-#ifdef USE_LIBIDN
+-#include <idna.h>
++#ifdef USE_LIBIDN2
++#include <idn2.h>
+ #endif
+
+ #ifdef USE_WINDOWS_SSPI
+@@ -723,83 +723,6 @@ const char *Curl_strerror(struct connectdata *conn, int err)
+ return buf;
+ }
+
+-#ifdef USE_LIBIDN
+-/*
+- * Return error-string for libidn status as returned from idna_to_ascii_lz().
+- */
+-const char *Curl_idn_strerror (struct connectdata *conn, int err)
+-{
+-#ifdef HAVE_IDNA_STRERROR
+- (void)conn;
+- return idna_strerror((Idna_rc) err);
+-#else
+- const char *str;
+- char *buf;
+- size_t max;
+-
+- DEBUGASSERT(conn);
+-
+- buf = conn->syserr_buf;
+- max = sizeof(conn->syserr_buf)-1;
+- *buf = '\0';
+-
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+- switch ((Idna_rc)err) {
+- case IDNA_SUCCESS:
+- str = "No error";
+- break;
+- case IDNA_STRINGPREP_ERROR:
+- str = "Error in string preparation";
+- break;
+- case IDNA_PUNYCODE_ERROR:
+- str = "Error in Punycode operation";
+- break;
+- case IDNA_CONTAINS_NON_LDH:
+- str = "Illegal ASCII characters";
+- break;
+- case IDNA_CONTAINS_MINUS:
+- str = "Contains minus";
+- break;
+- case IDNA_INVALID_LENGTH:
+- str = "Invalid output length";
+- break;
+- case IDNA_NO_ACE_PREFIX:
+- str = "No ACE prefix (\"xn--\")";
+- break;
+- case IDNA_ROUNDTRIP_VERIFY_ERROR:
+- str = "Round trip verify error";
+- break;
+- case IDNA_CONTAINS_ACE_PREFIX:
+- str = "Already have ACE prefix (\"xn--\")";
+- break;
+- case IDNA_ICONV_ERROR:
+- str = "Locale conversion failed";
+- break;
+- case IDNA_MALLOC_ERROR:
+- str = "Allocation failed";
+- break;
+- case IDNA_DLOPEN_ERROR:
+- str = "dlopen() error";
+- break;
+- default:
+- snprintf(buf, max, "error %d", err);
+- str = NULL;
+- break;
+- }
+-#else
+- if((Idna_rc)err == IDNA_SUCCESS)
+- str = "No error";
+- else
+- str = "Error";
+-#endif
+- if(str)
+- strncpy(buf, str, max);
+- buf[max] = '\0';
+- return (buf);
+-#endif
+-}
+-#endif /* USE_LIBIDN */
+-
+ #ifdef USE_WINDOWS_SSPI
+ const char *Curl_sspi_strerror (struct connectdata *conn, int err)
+ {
+diff --git a/lib/strerror.h b/lib/strerror.h
+index ae8c96b..627273e 100644
+--- a/lib/strerror.h
++++ b/lib/strerror.h
+@@ -7,7 +7,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -26,7 +26,7 @@
+
+ const char *Curl_strerror (struct connectdata *conn, int err);
+
+-#ifdef USE_LIBIDN
++#ifdef USE_LIBIDN2
+ const char *Curl_idn_strerror (struct connectdata *conn, int err);
+ #endif
+
+diff --git a/lib/url.c b/lib/url.c
+index 8832989..8d52152 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -59,24 +59,15 @@
+ #include <limits.h>
+ #endif
+
+-#ifdef USE_LIBIDN
+-#include <idna.h>
+-#include <tld.h>
+-#include <stringprep.h>
+-#ifdef HAVE_IDN_FREE_H
+-#include <idn-free.h>
+-#else
+-/* prototype from idn-free.h, not provided by libidn 0.4.5's make install! */
+-void idn_free (void *ptr);
+-#endif
+-#ifndef HAVE_IDN_FREE
+-/* if idn_free() was not found in this version of libidn use free() instead */
+-#define idn_free(x) (free)(x)
+-#endif
++#ifdef USE_LIBIDN2
++#include <idn2.h>
++
+ #elif defined(USE_WIN32_IDN)
+ /* prototype for curl_win32_idn_to_ascii() */
+ int curl_win32_idn_to_ascii(const char *in, char **out);
+-#endif /* USE_LIBIDN */
++#endif /* USE_LIBIDN2 */
++
++#include <idn2.h>
+
+ #include "urldata.h"
+ #include "netrc.h"
+@@ -3693,59 +3684,15 @@ static bool is_ASCII_name(const char *hostname)
+ return TRUE;
+ }
+
+-#ifdef USE_LIBIDN
+-/*
+- * Check if characters in hostname is allowed in Top Level Domain.
+- */
+-static bool tld_check_name(struct SessionHandle *data,
+- const char *ace_hostname)
+-{
+- size_t err_pos;
+- char *uc_name = NULL;
+- int rc;
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+- const char *tld_errmsg = "<no msg>";
+-#else
+- (void)data;
+-#endif
+-
+- /* Convert (and downcase) ACE-name back into locale's character set */
+- rc = idna_to_unicode_lzlz(ace_hostname, &uc_name, 0);
+- if(rc != IDNA_SUCCESS)
+- return FALSE;
+-
+- rc = tld_check_lz(uc_name, &err_pos, NULL);
+-#ifndef CURL_DISABLE_VERBOSE_STRINGS
+-#ifdef HAVE_TLD_STRERROR
+- if(rc != TLD_SUCCESS)
+- tld_errmsg = tld_strerror((Tld_rc)rc);
+-#endif
+- if(rc == TLD_INVALID)
+- infof(data, "WARNING: %s; pos %u = `%c'/0x%02X\n",
+- tld_errmsg, err_pos, uc_name[err_pos],
+- uc_name[err_pos] & 255);
+- else if(rc != TLD_SUCCESS)
+- infof(data, "WARNING: TLD check for %s failed; %s\n",
+- uc_name, tld_errmsg);
+-#endif /* CURL_DISABLE_VERBOSE_STRINGS */
+- if(uc_name)
+- idn_free(uc_name);
+- if(rc != TLD_SUCCESS)
+- return FALSE;
+-
+- return TRUE;
+-}
+-#endif
+-
+ /*
+ * Perform any necessary IDN conversion of hostname
+ */
+-static void fix_hostname(struct SessionHandle *data,
+- struct connectdata *conn, struct hostname *host)
++static void fix_hostname(struct connectdata *conn, struct hostname *host)
+ {
+ size_t len;
++ struct Curl_easy *data = conn->data;
+
+-#ifndef USE_LIBIDN
++#ifndef USE_LIBIDN2
+ (void)data;
+ (void)conn;
+ #elif defined(CURL_DISABLE_VERBOSE_STRINGS)
+@@ -3762,26 +3709,18 @@ static void fix_hostname(struct SessionHandle *data,
+ host->name[len-1]=0;
+
+ if(!is_ASCII_name(host->name)) {
+-#ifdef USE_LIBIDN
+- /*************************************************************
+- * Check name for non-ASCII and convert hostname to ACE form.
+- *************************************************************/
+- if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+- char *ace_hostname = NULL;
+- int rc = idna_to_ascii_lz(host->name, &ace_hostname, 0);
+- infof (data, "Input domain encoded as `%s'\n",
+- stringprep_locale_charset ());
+- if(rc != IDNA_SUCCESS)
+- infof(data, "Failed to convert %s to ACE; %s\n",
+- host->name, Curl_idn_strerror(conn, rc));
+- else {
+- /* tld_check_name() displays a warning if the host name contains
+- "illegal" characters for this TLD */
+- (void)tld_check_name(data, ace_hostname);
+-
+- host->encalloc = ace_hostname;
+- /* change the name pointer to point to the encoded hostname */
+- host->name = host->encalloc;
++#ifdef USE_LIBIDN2
++ if(idn2_check_version(IDN2_VERSION)) {
++ char *ace_hostname = NULL;
++ int rc = idn2_lookup_ul((const char *)host->name, &ace_hostname, 0);
++ if(rc == IDN2_OK) {
++ host->encalloc = (char *)ace_hostname;
++ /* change the name pointer to point to the encoded hostname */
++ host->name = host->encalloc;
++ }
++ else
++ infof(data, "Failed to convert %s to ACE; %s\n", host->name,
++ idn2_strerror(rc));
+ }
+ }
+ #elif defined(USE_WIN32_IDN)
+@@ -3809,9 +3748,9 @@ static void fix_hostname(struct SessionHandle *data,
+ */
+ static void free_fixed_hostname(struct hostname *host)
+ {
+-#if defined(USE_LIBIDN)
++#if defined(USE_LIBIDN2)
+ if(host->encalloc) {
+- idn_free(host->encalloc); /* must be freed with idn_free() since this was
++ idn2_free(host->encalloc); /* must be freed with idn2_free() since this was
+ allocated by libidn */
+ host->encalloc = NULL;
+ }
+@@ -5707,9 +5646,9 @@ static CURLcode create_conn(struct SessionHandle *data,
+ /*************************************************************
+ * IDN-fix the hostnames
+ *************************************************************/
+- fix_hostname(data, conn, &conn->host);
++ fix_hostname(conn, &conn->host);
+ if(conn->proxy.name && *conn->proxy.name)
+- fix_hostname(data, conn, &conn->proxy);
++ fix_hostname(conn, &conn->proxy);
+
+ /*************************************************************
+ * Setup internals depending on protocol. Needs to be done after
+diff --git a/lib/version.c b/lib/version.c
+index 7f14fa5..a5c9811 100644
+--- a/lib/version.c
++++ b/lib/version.c
+@@ -36,8 +36,8 @@
+ # include <ares.h>
+ #endif
+
+-#ifdef USE_LIBIDN
+-#include <stringprep.h>
++#ifdef USE_LIBIDN2
++#include <idn2.h>
+ #endif
+
+ #ifdef USE_LIBPSL
+@@ -97,9 +97,9 @@ char *curl_version(void)
+ left -= len;
+ ptr += len;
+ #endif
+-#ifdef USE_LIBIDN
+- if(stringprep_check_version(LIBIDN_REQUIRED_VERSION)) {
+- len = snprintf(ptr, left, " libidn/%s", stringprep_check_version(NULL));
++#ifdef USE_LIBIDN2
++ if(idn2_check_version(IDN2_VERSION)) {
++ len = snprintf(ptr, left, " libidn2/%s", idn2_check_version(NULL));
+ left -= len;
+ ptr += len;
+ }
+@@ -344,10 +344,10 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
+ version_info.ares_num = aresnum;
+ }
+ #endif
+-#ifdef USE_LIBIDN
++#ifdef USE_LIBIDN2
+ /* This returns a version string if we use the given version or later,
+ otherwise it returns NULL */
+- version_info.libidn = stringprep_check_version(LIBIDN_REQUIRED_VERSION);
++ version_info.libidn = idn2_check_version(IDN2_VERSION);
+ if(version_info.libidn)
+ version_info.features |= CURL_VERSION_IDN;
+ #elif defined(USE_WIN32_IDN)
diff --git a/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch b/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch
new file mode 100644
index 0000000..3549101
--- /dev/null
+++ b/meta/recipes-support/curl/curl/url-remove-unconditional-idn2.h-include.patch
@@ -0,0 +1,29 @@
+From c27013c05d99d92370b57e1a7af1b854eef4e7c1 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Mon, 31 Oct 2016 09:49:50 +0100
+Subject: [PATCH] url: remove unconditional idn2.h include
+
+Mistake brought by 9c91ec778104a [fix to CVE-2016-8625]
+Upstream-Status: Backport
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/url.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/lib/url.c b/lib/url.c
+index c90a1c5..b997f41 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -67,8 +67,6 @@
+ bool curl_win32_idn_to_ascii(const char *in, char **out);
+ #endif /* USE_LIBIDN2 */
+
+-#include <idn2.h>
+-
+ #include "urldata.h"
+ #include "netrc.h"
+
+--
+1.9.1
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 3c877e4..7fab7cf 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -25,6 +25,8 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8622.patch \
file://CVE-2016-8623.patch \
file://CVE-2016-8624.patch \
+ file://CVE-2016-8625.patch \
+ file://url-remove-unconditional-idn2.h-include.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 09/11] curl: CVE-2016-8623
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
Use-after-free via shared cookies
Affected versions: curl 7.10.7 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102I.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8623.patch | 209 +++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 210 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8623.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8623.patch b/meta/recipes-support/curl/curl/CVE-2016-8623.patch
new file mode 100644
index 0000000..d9ddef6
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8623.patch
@@ -0,0 +1,209 @@
+From d9d57fe0da6f25d05570fd583520ecd321ed9c3f Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 4 Oct 2016 23:26:13 +0200
+Subject: [PATCH] cookies: getlist() now holds deep copies of all cookies
+
+Previously it only held references to them, which was reckless as the
+thread lock was released so the cookies could get modified by other
+handles that share the same cookie jar over the share interface.
+
+CVE: CVE-2016-8623
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102I.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/cookie.c | 61 +++++++++++++++++++++++++++++++++++++++---------------------
+ lib/cookie.h | 4 ++--
+ lib/http.c | 2 +-
+ 3 files changed, 43 insertions(+), 24 deletions(-)
+
+diff --git a/lib/cookie.c b/lib/cookie.c
+index 0f05da2..8607ce3 100644
+--- a/lib/cookie.c
++++ b/lib/cookie.c
+@@ -1022,10 +1022,44 @@ static int cookie_sort(const void *p1, const void *p2)
+
+ /* sorry, can't be more deterministic */
+ return 0;
+ }
+
++#define CLONE(field) \
++ do { \
++ if(src->field) { \
++ dup->field = strdup(src->field); \
++ if(!dup->field) \
++ goto fail; \
++ } \
++ } while(0)
++
++static struct Cookie *dup_cookie(struct Cookie *src)
++{
++ struct Cookie *dup = calloc(sizeof(struct Cookie), 1);
++ if(dup) {
++ CLONE(expirestr);
++ CLONE(domain);
++ CLONE(path);
++ CLONE(spath);
++ CLONE(name);
++ CLONE(value);
++ CLONE(maxage);
++ CLONE(version);
++ dup->expires = src->expires;
++ dup->tailmatch = src->tailmatch;
++ dup->secure = src->secure;
++ dup->livecookie = src->livecookie;
++ dup->httponly = src->httponly;
++ }
++ return dup;
++
++ fail:
++ freecookie(dup);
++ return NULL;
++}
++
+ /*****************************************************************************
+ *
+ * Curl_cookie_getlist()
+ *
+ * For a given host and path, return a linked list of cookies that the
+@@ -1077,15 +1111,12 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
+ if(!co->spath || pathmatch(co->spath, path) ) {
+
+ /* and now, we know this is a match and we should create an
+ entry for the return-linked-list */
+
+- newco = malloc(sizeof(struct Cookie));
++ newco = dup_cookie(co);
+ if(newco) {
+- /* first, copy the whole source cookie: */
+- memcpy(newco, co, sizeof(struct Cookie));
+-
+ /* then modify our next */
+ newco->next = mainco;
+
+ /* point the main to us */
+ mainco = newco;
+@@ -1093,16 +1124,11 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
+ matches++;
+ }
+ else {
+ fail:
+ /* failure, clear up the allocated chain and return NULL */
+- while(mainco) {
+- co = mainco->next;
+- free(mainco);
+- mainco = co;
+- }
+-
++ Curl_cookie_freelist(mainco);
+ return NULL;
+ }
+ }
+ }
+ }
+@@ -1150,11 +1176,11 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
+ *
+ ****************************************************************************/
+ void Curl_cookie_clearall(struct CookieInfo *cookies)
+ {
+ if(cookies) {
+- Curl_cookie_freelist(cookies->cookies, TRUE);
++ Curl_cookie_freelist(cookies->cookies);
+ cookies->cookies = NULL;
+ cookies->numcookies = 0;
+ }
+ }
+
+@@ -1162,25 +1188,18 @@ void Curl_cookie_clearall(struct CookieInfo *cookies)
+ *
+ * Curl_cookie_freelist()
+ *
+ * Free a list of cookies previously returned by Curl_cookie_getlist();
+ *
+- * The 'cookiestoo' argument tells this function whether to just free the
+- * list or actually also free all cookies within the list as well.
+- *
+ ****************************************************************************/
+
+-void Curl_cookie_freelist(struct Cookie *co, bool cookiestoo)
++void Curl_cookie_freelist(struct Cookie *co)
+ {
+ struct Cookie *next;
+ while(co) {
+ next = co->next;
+- if(cookiestoo)
+- freecookie(co);
+- else
+- free(co); /* we only free the struct since the "members" are all just
+- pointed out in the main cookie list! */
++ freecookie(co);
+ co = next;
+ }
+ }
+
+
+@@ -1231,11 +1250,11 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies)
+ ****************************************************************************/
+ void Curl_cookie_cleanup(struct CookieInfo *c)
+ {
+ if(c) {
+ free(c->filename);
+- Curl_cookie_freelist(c->cookies, TRUE);
++ Curl_cookie_freelist(c->cookies);
+ free(c); /* free the base struct as well */
+ }
+ }
+
+ /* get_netscape_format()
+diff --git a/lib/cookie.h b/lib/cookie.h
+index cd7c54a..a9a4578 100644
+--- a/lib/cookie.h
++++ b/lib/cookie.h
+@@ -5,11 +5,11 @@
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+@@ -80,11 +80,11 @@ struct Cookie *Curl_cookie_add(struct Curl_easy *data,
+ struct CookieInfo *, bool header, char *lineptr,
+ const char *domain, const char *path);
+
+ struct Cookie *Curl_cookie_getlist(struct CookieInfo *, const char *,
+ const char *, bool);
+-void Curl_cookie_freelist(struct Cookie *cookies, bool cookiestoo);
++void Curl_cookie_freelist(struct Cookie *cookies);
+ void Curl_cookie_clearall(struct CookieInfo *cookies);
+ void Curl_cookie_clearsess(struct CookieInfo *cookies);
+
+ #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
+ #define Curl_cookie_list(x) NULL
+diff --git a/lib/http.c b/lib/http.c
+index 65c145a..e6e7d37 100644
+--- a/lib/http.c
++++ b/lib/http.c
+@@ -2382,11 +2382,11 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
+ break;
+ count++;
+ }
+ co = co->next; /* next cookie please */
+ }
+- Curl_cookie_freelist(store, FALSE); /* free the cookie list */
++ Curl_cookie_freelist(store);
+ }
+ if(addcookies && !result) {
+ if(!count)
+ result = Curl_add_bufferf(req_buffer, "Cookie: ");
+ if(!result) {
+--
+2.9.3
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 4bff34e..0f8fa3a 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -23,6 +23,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8620.patch \
file://CVE-2016-8621.patch \
file://CVE-2016-8622.patch \
+ file://CVE-2016-8623.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 08/11] curl: CVE-2016-8622
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
URL unescape heap overflow via integer truncation
Affected versions: curl 7.24.0 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102H.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8622.patch | 94 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 95 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8622.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8622.patch b/meta/recipes-support/curl/curl/CVE-2016-8622.patch
new file mode 100644
index 0000000..8edad01
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8622.patch
@@ -0,0 +1,94 @@
+From 53e71e47d6b81650d26ec33a58d0dca24c7ffb2c Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 4 Oct 2016 18:56:45 +0200
+Subject: [PATCH] unescape: avoid integer overflow
+
+CVE: CVE-2016-8622
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102H.html
+Reported-by: Cure53
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+
+diff -ruN a/docs/libcurl/curl_easy_unescape.3 b/docs/libcurl/curl_easy_unescape.3
+--- a/docs/libcurl/curl_easy_unescape.3 2016-02-03 00:08:02.000000000 +0100
++++ b/docs/libcurl/curl_easy_unescape.3 2016-11-07 09:25:45.999933275 +0100
+@@ -5,7 +5,7 @@
+ .\" * | (__| |_| | _ <| |___
+ .\" * \___|\___/|_| \_\_____|
+ .\" *
+-.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
++.\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ .\" *
+ .\" * This software is licensed as described in the file COPYING, which
+ .\" * you should have received as part of this distribution. The terms
+@@ -40,7 +40,10 @@
+
+ If \fBoutlength\fP is non-NULL, the function will write the length of the
+ returned string in the integer it points to. This allows an escaped string
+-containing %00 to still get used properly after unescaping.
++containing %00 to still get used properly after unescaping. Since this is a
++pointer to an \fIint\fP type, it can only return a value up to INT_MAX so no
++longer string can be unescaped if the string length is returned in this
++parameter.
+
+ You must \fIcurl_free(3)\fP the returned string when you're done with it.
+ .SH AVAILABILITY
+diff -ruN a/lib/dict.c b/lib/dict.c
+--- a/lib/dict.c 2016-02-03 00:02:44.000000000 +0100
++++ b/lib/dict.c 2016-11-07 09:25:45.999933275 +0100
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -52,7 +52,7 @@
+ #include <curl/curl.h>
+ #include "transfer.h"
+ #include "sendf.h"
+-
++#include "escape.h"
+ #include "progress.h"
+ #include "strequal.h"
+ #include "dict.h"
+@@ -96,12 +96,12 @@
+ char *newp;
+ char *dictp;
+ char *ptr;
+- int len;
++ size_t len;
+ char ch;
+ int olen=0;
+
+- newp = curl_easy_unescape(data, inputbuff, 0, &len);
+- if(!newp)
++ CURLcode result = Curl_urldecode(data, inputbuff, 0, &newp, &len, FALSE);
++ if(!newp || result)
+ return NULL;
+
+ dictp = malloc(((size_t)len)*2 + 1); /* add one for terminating zero */
+diff -ruN a/lib/escape.c b/lib/escape.c
+--- a/lib/escape.c 2016-02-05 10:02:03.000000000 +0100
++++ b/lib/escape.c 2016-11-07 09:29:43.073671606 +0100
+@@ -217,8 +217,14 @@
+ FALSE);
+ if(res)
+ return NULL;
+- if(olen)
+- *olen = curlx_uztosi(outputlen);
++
++ if(olen) {
++ if(outputlen <= (size_t) INT_MAX)
++ *olen = curlx_uztosi(outputlen);
++ else
++ /* too large to return in an int, fail! */
++ Curl_safefree(str);
++ }
+ return str;
+ }
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 67b07da..4bff34e 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -22,6 +22,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8619.patch \
file://CVE-2016-8620.patch \
file://CVE-2016-8621.patch \
+ file://CVE-2016-8622.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 07/11] curl: CVE-2016-8621
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
curl_getdate read out of bounds
Affected versions: curl 7.12.2 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102G.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8621.patch | 120 +++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 121 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8621.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8621.patch b/meta/recipes-support/curl/curl/CVE-2016-8621.patch
new file mode 100644
index 0000000..7345838
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8621.patch
@@ -0,0 +1,120 @@
+From 8a6d9ded5f02f0294ae63a007e26087316c1998e Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 4 Oct 2016 16:59:38 +0200
+Subject: [PATCH] parsedate: handle cut off numbers better
+
+... and don't read outside of the given buffer!
+
+CVE: CVE-2016-8621
+Upstream-Status: Backport
+
+bug: https://curl.haxx.se/docs/adv_20161102G.html
+Reported-by: Luật Nguyễn
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/parsedate.c | 12 +++++++-----
+ tests/data/test517 | 6 ++++++
+ tests/libtest/lib517.c | 8 +++++++-
+ 3 files changed, 20 insertions(+), 6 deletions(-)
+
+diff --git a/lib/parsedate.c b/lib/parsedate.c
+index dfcf855..8e932f4 100644
+--- a/lib/parsedate.c
++++ b/lib/parsedate.c
+@@ -3,11 +3,11 @@
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+@@ -384,19 +384,21 @@ static int parsedate(const char *date, time_t *output)
+ }
+ else if(ISDIGIT(*date)) {
+ /* a digit */
+ int val;
+ char *end;
++ int len=0;
+ if((secnum == -1) &&
+- (3 == sscanf(date, "%02d:%02d:%02d", &hournum, &minnum, &secnum))) {
++ (3 == sscanf(date, "%02d:%02d:%02d%n",
++ &hournum, &minnum, &secnum, &len))) {
+ /* time stamp! */
+- date += 8;
++ date += len;
+ }
+ else if((secnum == -1) &&
+- (2 == sscanf(date, "%02d:%02d", &hournum, &minnum))) {
++ (2 == sscanf(date, "%02d:%02d%n", &hournum, &minnum, &len))) {
+ /* time stamp without seconds */
+- date += 5;
++ date += len;
+ secnum = 0;
+ }
+ else {
+ long lval;
+ int error;
+diff --git a/tests/data/test517 b/tests/data/test517
+index c81a45e..513634f 100644
+--- a/tests/data/test517
++++ b/tests/data/test517
+@@ -114,10 +114,16 @@ nothing
+ 79: 20110632 12:34:56 => -1
+ 80: 20110623 56:34:56 => -1
+ 81: 20111323 12:34:56 => -1
+ 82: 20110623 12:34:79 => -1
+ 83: Wed, 31 Dec 2008 23:59:60 GMT => 1230768000
++84: 20110623 12:3 => 1308830580
++85: 20110623 1:3 => 1308790980
++86: 20110623 1:30 => 1308792600
++87: 20110623 12:12:3 => 1308831123
++88: 20110623 01:12:3 => 1308791523
++89: 20110623 01:99:30 => -1
+ </stdout>
+
+ # This test case previously tested an overflow case ("2094 Nov 6 =>
+ # 2147483647") for 32bit time_t, but since some systems have 64bit time_t and
+ # handles this (returning 3939840000), and some 64bit-time_t systems don't
+diff --git a/tests/libtest/lib517.c b/tests/libtest/lib517.c
+index 2f68ebd..22162ff 100644
+--- a/tests/libtest/lib517.c
++++ b/tests/libtest/lib517.c
+@@ -3,11 +3,11 @@
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+@@ -114,10 +114,16 @@ static const char * const dates[]={
+ "20110632 12:34:56",
+ "20110623 56:34:56",
+ "20111323 12:34:56",
+ "20110623 12:34:79",
+ "Wed, 31 Dec 2008 23:59:60 GMT", /* leap second */
++ "20110623 12:3",
++ "20110623 1:3",
++ "20110623 1:30",
++ "20110623 12:12:3",
++ "20110623 01:12:3",
++ "20110623 01:99:30",
+ NULL
+ };
+
+ int test(char *URL)
+ {
+--
+2.9.3
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index e6ad03f..67b07da 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -21,6 +21,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8618.patch \
file://CVE-2016-8619.patch \
file://CVE-2016-8620.patch \
+ file://CVE-2016-8621.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 06/11] curl: CVE-2016-8620
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
glob parser write/read out of bounds
Affected versions: curl 7.34.0 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102F.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8620.patch | 44 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 45 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8620.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8620.patch b/meta/recipes-support/curl/curl/CVE-2016-8620.patch
new file mode 100644
index 0000000..613ace3
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8620.patch
@@ -0,0 +1,44 @@
+From fbb5f1aa0326d485d5a7ac643b48481897ca667f Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Mon, 3 Oct 2016 17:27:16 +0200
+Subject: [PATCH] range: prevent negative end number in a glob range
+
+CVE: CVE-2016-8620
+
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102F.html
+Reported-by: Luật Nguyễn
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ src/tool_urlglob.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
+index a357b8b..64c75ba 100644
+--- a/src/tool_urlglob.c
++++ b/src/tool_urlglob.c
+@@ -257,6 +257,12 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
+ endp = NULL;
+ else {
+ pattern = endp+1;
++ while(*pattern && ISBLANK(*pattern))
++ pattern++;
++ if(!ISDIGIT(*pattern)) {
++ endp = NULL;
++ goto fail;
++ }
+ errno = 0;
+ max_n = strtoul(pattern, &endp, 10);
+ if(errno || (*endp == ':')) {
+@@ -277,6 +283,7 @@ static CURLcode glob_range(URLGlob *glob, char **patternp,
+ }
+ }
+
++ fail:
+ *posp += (pattern - *patternp);
+
+ if(!endp || (min_n > max_n) || (step_n > (max_n - min_n)) || !step_n)
+--
+1.9.1
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 9ef5718..e6ad03f 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -20,6 +20,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8617.patch \
file://CVE-2016-8618.patch \
file://CVE-2016-8619.patch \
+ file://CVE-2016-8620.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 05/11] curl: CVE-2016-8619
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
double-free in krb5 code
Affected versions: curl 7.3 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102E.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8619.patch | 52 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 53 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8619.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8619.patch b/meta/recipes-support/curl/curl/CVE-2016-8619.patch
new file mode 100644
index 0000000..fb21cf6
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8619.patch
@@ -0,0 +1,52 @@
+From 91239f7040b1f026d4d15765e7e3f58e92e93761 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Wed, 28 Sep 2016 12:56:02 +0200
+Subject: [PATCH] krb5: avoid realloc(0)
+
+If the requested size is zero, bail out with error instead of doing a
+realloc() that would cause a double-free: realloc(0) acts as a free()
+and then there's a second free in the cleanup path.
+
+CVE: CVE-2016-8619
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102E.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/security.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/security.c b/lib/security.c
+index a268d4a..4cef8f8 100644
+--- a/lib/security.c
++++ b/lib/security.c
+@@ -190,19 +190,22 @@ socket_write(struct connectdata *conn, curl_socket_t fd, const void *to,
+ static CURLcode read_data(struct connectdata *conn,
+ curl_socket_t fd,
+ struct krb5buffer *buf)
+ {
+ int len;
+- void* tmp;
++ void *tmp = NULL;
+ CURLcode result;
+
+ result = socket_read(fd, &len, sizeof(len));
+ if(result)
+ return result;
+
+- len = ntohl(len);
+- tmp = realloc(buf->data, len);
++ if(len) {
++ /* only realloc if there was a length */
++ len = ntohl(len);
++ tmp = realloc(buf->data, len);
++ }
+ if(tmp == NULL)
+ return CURLE_OUT_OF_MEMORY;
+
+ buf->data = tmp;
+ result = socket_read(fd, buf->data, len);
+--
+2.9.3
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 27a999e..9ef5718 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -19,6 +19,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8616.patch \
file://CVE-2016-8617.patch \
file://CVE-2016-8618.patch \
+ file://CVE-2016-8619.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 04/11] curl: CVE-2016-8618
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
double-free in curl_maprintf
Affected versions: curl 7.1 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102D.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8618.patch | 52 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 53 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8618.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8618.patch b/meta/recipes-support/curl/curl/CVE-2016-8618.patch
new file mode 100644
index 0000000..2fd4749
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8618.patch
@@ -0,0 +1,52 @@
+From 31106a073882656a2a5ab56c4ce2847e9a334c3c Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Wed, 28 Sep 2016 10:15:34 +0200
+Subject: [PATCH] aprintf: detect wrap-around when growing allocation
+
+On 32bit systems we could otherwise wrap around after 2GB and allocate 0
+bytes and crash.
+
+CVE: CVE-2016-8618
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102D.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/mprintf.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/mprintf.c b/lib/mprintf.c
+index dbedeaa..2c88aa8 100644
+--- a/lib/mprintf.c
++++ b/lib/mprintf.c
+@@ -1034,20 +1034,23 @@ static int alloc_addbyter(int output, FILE *data)
+ }
+ infop->alloc = 32;
+ infop->len =0;
+ }
+ else if(infop->len+1 >= infop->alloc) {
+- char *newptr;
++ char *newptr = NULL;
++ size_t newsize = infop->alloc*2;
+
+- newptr = realloc(infop->buffer, infop->alloc*2);
++ /* detect wrap-around or other overflow problems */
++ if(newsize > infop->alloc)
++ newptr = realloc(infop->buffer, newsize);
+
+ if(!newptr) {
+ infop->fail = 1;
+ return -1; /* fail */
+ }
+ infop->buffer = newptr;
+- infop->alloc *= 2;
++ infop->alloc = newsize;
+ }
+
+ infop->buffer[ infop->len ] = outc;
+
+ infop->len++;
+--
+2.9.3
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 3724411..27a999e 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -18,6 +18,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-8615.patch \
file://CVE-2016-8616.patch \
file://CVE-2016-8617.patch \
+ file://CVE-2016-8618.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 03/11] curl: CVE-2016-8617
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
OOB write via unchecked multiplication
Affected versions: curl 7.1 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102C.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8617.patch | 28 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 29 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8617.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8617.patch b/meta/recipes-support/curl/curl/CVE-2016-8617.patch
new file mode 100644
index 0000000..d16c2f5
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8617.patch
@@ -0,0 +1,28 @@
+From efd24d57426bd77c9b5860e6b297904703750412 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Wed, 28 Sep 2016 00:05:12 +0200
+Subject: [PATCH] base64: check for integer overflow on large input
+
+CVE: CVE-2016-8617
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102C.html
+Reported-by: Cure53
+
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+diff -ruN a/lib/base64.c b/lib/base64.c
+--- a/lib/base64.c 2016-02-03 00:02:43.000000000 +0100
++++ b/lib/base64.c 2016-11-07 09:22:07.918167530 +0100
+@@ -190,6 +190,11 @@
+ if(0 == insize)
+ insize = strlen(indata);
+
++#if SIZEOF_SIZE_T == 4
++ if(insize > UINT_MAX/4)
++ return CURLE_OUT_OF_MEMORY;
++#endif
++
+ base64data = output = malloc(insize*4/3+4);
+ if(NULL == output)
+ return CURLE_OUT_OF_MEMORY;
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 20c3721..3724411 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -17,6 +17,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-7141.patch \
file://CVE-2016-8615.patch \
file://CVE-2016-8616.patch \
+ file://CVE-2016-8617.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 02/11] curl: CVE-2016-8616
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
In-Reply-To: <1479200900-39007-1-git-send-email-sona.sarmadi@enea.com>
case insensitive password comparison
Affected versions: curl 7.7 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102B.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8616.patch | 49 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 50 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8616.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8616.patch b/meta/recipes-support/curl/curl/CVE-2016-8616.patch
new file mode 100644
index 0000000..d5d78fc
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8616.patch
@@ -0,0 +1,49 @@
+From b3ee26c5df75d97f6895e6ec4538894ebaf76e48 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 27 Sep 2016 18:01:53 +0200
+Subject: [PATCH] connectionexists: use case sensitive user/password
+ comparisons
+
+CVE: CVE-2016-8616
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102B.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+
+diff -ruN a/lib/url.c b/lib/url.c
+--- a/lib/url.c 2016-11-07 08:50:23.030126833 +0100
++++ b/lib/url.c 2016-11-07 09:16:20.459836564 +0100
+@@ -3305,8 +3305,8 @@
+ if(!(needle->handler->flags & PROTOPT_CREDSPERREQUEST)) {
+ /* This protocol requires credentials per connection,
+ so verify that we're using the same name and password as well */
+- if(!strequal(needle->user, check->user) ||
+- !strequal(needle->passwd, check->passwd)) {
++ if(strcmp(needle->user, check->user) ||
++ strcmp(needle->passwd, check->passwd)) {
+ /* one of them was different */
+ continue;
+ }
+@@ -3369,8 +3369,8 @@
+ possible. (Especially we must not reuse the same connection if
+ partway through a handshake!) */
+ if(wantNTLMhttp) {
+- if(!strequal(needle->user, check->user) ||
+- !strequal(needle->passwd, check->passwd))
++ if(strcmp(needle->user, check->user) ||
++ strcmp(needle->passwd, check->passwd))
+ continue;
+ }
+ else if(check->ntlm.state != NTLMSTATE_NONE) {
+@@ -3380,8 +3380,8 @@
+
+ /* Same for Proxy NTLM authentication */
+ if(wantProxyNTLMhttp) {
+- if(!strequal(needle->proxyuser, check->proxyuser) ||
+- !strequal(needle->proxypasswd, check->proxypasswd))
++ if(strcmp(needle->proxyuser, check->proxyuser) ||
++ strcmp(needle->proxypasswd, check->proxypasswd))
+ continue;
+ }
+ else if(check->proxyntlm.state != NTLMSTATE_NONE) {
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 1f2758c..20c3721 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -16,6 +16,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-5421.patch \
file://CVE-2016-7141.patch \
file://CVE-2016-8615.patch \
+ file://CVE-2016-8616.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCHv5][krogoth 01/11] curl: CVE-2016-8615
From: Sona Sarmadi @ 2016-11-15 9:08 UTC (permalink / raw)
To: openembedded-core; +Cc: sona
cookie injection for other servers
Affected versions: curl 7.1 to and including 7.50.3
Reference:
https://curl.haxx.se/docs/adv_20161102A.html
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
---
meta/recipes-support/curl/curl/CVE-2016-8615.patch | 77 ++++++++++++++++++++++
meta/recipes-support/curl/curl_7.47.1.bb | 1 +
2 files changed, 78 insertions(+)
create mode 100644 meta/recipes-support/curl/curl/CVE-2016-8615.patch
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8615.patch b/meta/recipes-support/curl/curl/CVE-2016-8615.patch
new file mode 100644
index 0000000..5faa423
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2016-8615.patch
@@ -0,0 +1,77 @@
+From 1620f552a277ed5b23a48b9c27dbf07663cac068 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Tue, 27 Sep 2016 17:36:19 +0200
+Subject: [PATCH] cookie: replace use of fgets() with custom version
+
+... that will ignore lines that are too long to fit in the buffer.
+
+CVE: CVE-2016-8615
+Upstream-Status: Backport
+
+Bug: https://curl.haxx.se/docs/adv_20161102A.html
+Reported-by: Cure53
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+---
+ lib/cookie.c | 31 ++++++++++++++++++++++++++++++-
+ 1 file changed, 30 insertions(+), 1 deletion(-)
+
+diff --git a/lib/cookie.c b/lib/cookie.c
+index 0f05da2..e5097d3 100644
+--- a/lib/cookie.c
++++ b/lib/cookie.c
+@@ -901,10 +901,39 @@ Curl_cookie_add(struct Curl_easy *data,
+ }
+
+ return co;
+ }
+
++/*
++ * get_line() makes sure to only return complete whole lines that fit in 'len'
++ * bytes and end with a newline.
++ */
++static char *get_line(char *buf, int len, FILE *input)
++{
++ bool partial = FALSE;
++ while(1) {
++ char *b = fgets(buf, len, input);
++ if(b) {
++ size_t rlen = strlen(b);
++ if(rlen && (b[rlen-1] == '\n')) {
++ if(partial) {
++ partial = FALSE;
++ continue;
++ }
++ return b;
++ }
++ else
++ /* read a partial, discard the next piece that ends with newline */
++ partial = TRUE;
++ }
++ else
++ break;
++ }
++ return NULL;
++}
++
++
+ /*****************************************************************************
+ *
+ * Curl_cookie_init()
+ *
+ * Inits a cookie struct to read data from a local file. This is always
+@@ -957,11 +986,11 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
+ bool headerline;
+
+ line = malloc(MAX_COOKIE_LINE);
+ if(!line)
+ goto fail;
+- while(fgets(line, MAX_COOKIE_LINE, fp)) {
++ while(get_line(line, MAX_COOKIE_LINE, fp)) {
+ if(checkprefix("Set-Cookie:", line)) {
+ /* This is a cookie line, get it! */
+ lineptr=&line[11];
+ headerline=TRUE;
+ }
+--
+2.9.3
+
diff --git a/meta/recipes-support/curl/curl_7.47.1.bb b/meta/recipes-support/curl/curl_7.47.1.bb
index 3670a11..1f2758c 100644
--- a/meta/recipes-support/curl/curl_7.47.1.bb
+++ b/meta/recipes-support/curl/curl_7.47.1.bb
@@ -15,6 +15,7 @@ SRC_URI += " file://configure_ac.patch \
file://CVE-2016-5420.patch \
file://CVE-2016-5421.patch \
file://CVE-2016-7141.patch \
+ file://CVE-2016-8615.patch \
"
SRC_URI[md5sum] = "9ea3123449439bbd960cd25cf98796fb"
--
1.9.1
^ permalink raw reply related
* [PATCH 00/57] Consolidated Pull
From: Ross Burton @ 2016-11-15 8:55 UTC (permalink / raw)
To: openembedded-core
Consolidated pull, generally green on the AB. The last build run failed in
qemumips64 sanity testing but has previously passed so this appears to be a new
transient failure. oe-core runs are failing in eSDK creation but this needs
modifications to the autobuiler itself.
Ross
The following changes since commit 43e652f3d1fee5ce7fad67e6400315eab1b34270:
devtool: add "rename" subcommand (2016-11-07 11:04:22 +0000)
are available in the git repository at:
ssh://git@git.yoctoproject.org/poky-contrib ross/mut
for you to fetch changes up to cb4f6ebe47032fba4d63259524aa4f3d36e1b0aa:
maintainers.inc: remove libwnck3 recipe (2016-11-15 08:49:49 +0000)
----------------------------------------------------------------
Alexander Kanavin (1):
maintainers.inc: remove libwnck3 recipe
Alistair Francis (1):
runqemu: Split out the base name of QB_DEFAULT_KERNEL
André Draszik (2):
image-buildinfo: treat staged changes as modified branch, too
cve-check.bbclass: CVE-2014-2524 / readline v5.2
Armin Kuster (2):
tzcode: update to 2016i
tzdata: update to 2016i
Brad Bishop (1):
libyaml: Enable nativesdk bake
Carlos Alberto Lopez Perez (1):
webkitgtk: drop patch 0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
Ed Bartosh (1):
systemd-bootdisk.wks: use PARTUUID
Fabio Berton (5):
serf: Update to version 1.3.9
grep: Update to version 2.26
curl: Update to version 7.51.0
gawk: Update to version 4.1.4
libpcap: Update to version 1.8.1
Fathi Boudra (1):
wayland: upgrade from 1.11.1 to 1.12.0
Jackie Huang (1):
classes/cpan-base: fix for PERLVERSION
Joe Konno (1):
initrdscripts: add support for NVME target install
Joshua Lock (5):
lib/oe/path: remove duplicate import
lib/oe/lsb: make the release dict keys consistent regardless of source
lib/oe/lsb: prefer /etc/os-release for distribution data
lib/oe/lsb: attempt to ensure consistent distro id regardless of source
poky: update SANITY_TEST_DISTROS for new format
Jussi Kukkonen (1):
conf: Remove legacy X input drivers
Khem Raj (3):
libbsd: Fix build with musl
glibc-2.0: Detect pthread_getname_np() before use
x264: Update to latest on stable branch
Koen Kooi (1):
libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
Li Zhou (1):
db: disable the ARM assembler mutex code
Maciej Borzecki (5):
wic: make sure that partition size is always an integer in internal processing
wic: use partition size when creating empty partition files
wic: check that filesystem is specified for a rootfs partition
wic: fix function comment typos
oe-selftest: fix handling of test cases without ID in --list-tests-by
Markus Lehtonen (1):
sanity.bbclass: fix logging of an error
Maxin B. John (1):
ref-images.xml: remove core-image-directfb reference
Richard Purdie (1):
chrpath: Remove standard search paths from RPATHS
Robert Yang (2):
qemuarm64.conf: make runqemu's graphics work
populate_sdk_ext.bbclass: check unfsd before create it
Ross Burton (6):
conf/distro/include/maintainers: move toolchain to Khem Raj
Revert "oeqa/selftest/kernel.py: Add new file destined for kernel related tests"
distro_check: MeeGo is long dead, compare against Clear Linux instead
lib/oe/qa: handle binaries with segments outside the first 4kb
systemtap: remove explicit msgfmt check
systemtap: fix native linking on recent Ubuntu
Zubair Lutfullah Kakakhel (13):
arch-mips: Add o32 in TUNE_FEATURES for MIPS32R6
arch-mips: Add MACHINEOVERRIDES variables to reduce duplication
bitbake.conf: Reduce duplication in MIPS variants
fts: Reduce duplication in MIPS variants.
glibc: Reduce duplication in MIPS variants
packagegroup: Reduce duplication in MIPS variants.
gcc-runtime: Reduce duplication in MIPS variants.
gdb: Reduce duplication in MIPS variants.
mmc-utils: Reduce duplication in MIPS variants.
valgrind: Reduce duplication in MIPS variants.
ghostscript: Reduce duplication in MIPS variants.
mdadm: Reduce duplication in MIPS variants.
webkit: Reduce duplication in MIPS variants.
documentation/ref-manual/ref-images.xml | 3 -
meta-poky/conf/distro/include/maintainers.inc | 59 ++--
meta-poky/conf/distro/poky.conf | 24 +-
meta-yocto-bsp/conf/machine/beaglebone.conf | 4 +-
meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf | 1 -
meta/classes/chrpath.bbclass | 13 +-
meta/classes/cpan-base.bbclass | 2 +-
meta/classes/cve-check.bbclass | 2 +-
meta/classes/image-buildinfo.bbclass | 4 +-
meta/classes/populate_sdk_ext.bbclass | 5 +-
meta/classes/sanity.bbclass | 2 +-
meta/conf/bitbake.conf | 11 +-
meta/conf/machine/include/mips/README | 3 +
meta/conf/machine/include/mips/arch-mips.inc | 12 +
meta/conf/machine/include/tune-mips32r6.inc | 8 +-
meta/conf/machine/qemuarm64.conf | 2 +-
meta/lib/oe/distro_check.py | 16 +-
meta/lib/oe/lsb.py | 73 +++--
meta/lib/oe/path.py | 1 -
meta/lib/oe/qa.py | 82 ++---
meta/lib/oeqa/selftest/kernel.py | 29 --
meta/recipes-connectivity/libpcap/libpcap.inc | 5 +-
.../libpcap/libpcap/aclocal.patch | 167 ----------
.../libpcap/libpcap-pkgconfig-support.patch | 32 +-
.../libpcap/{libpcap_1.7.4.bb => libpcap_1.8.1.bb} | 13 +-
meta/recipes-core/fts/fts.bb | 5 +-
...st-for-pthread_getname_np-before-using-it.patch | 70 ++++
meta/recipes-core/glib-2.0/glib-2.0_2.50.1.bb | 1 +
meta/recipes-core/glibc/glibc-ld.inc | 17 +-
.../initrdscripts/files/init-install-efi.sh | 5 +-
.../initrdscripts/files/init-install.sh | 5 +-
.../packagegroups/packagegroup-core-sdk.bb | 5 +-
.../packagegroup-core-tools-profile.bb | 10 +-
meta/recipes-devtools/gcc/gcc-runtime.inc | 9 +-
meta/recipes-devtools/gdb/gdb-common.inc | 7 +-
meta/recipes-devtools/mmc/mmc-utils_git.bb | 4 +-
meta/recipes-devtools/valgrind/valgrind_3.12.0.bb | 3 +-
.../gawk/{gawk-4.1.3 => gawk-4.1.4}/run-ptest | 0
.../test-arrayind1-Remove-hashbang-line.patch | 30 ++
.../gawk/{gawk_4.1.3.bb => gawk_4.1.4.bb} | 5 +-
.../ghostscript/ghostscript_9.19.bb | 3 +-
.../grep/{grep_2.25.bb => grep_2.26.bb} | 4 +-
meta/recipes-extended/mdadm/mdadm_3.4.bb | 4 +-
...code-native_2016h.bb => tzcode-native_2016i.bb} | 8 +-
.../tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} | 4 +-
...0001-scanner-Use-unit32_t-instead-of-uint.patch | 30 --
.../{wayland_1.11.1.bb => wayland_1.12.0.bb} | 5 +-
.../systemtap/systemtap/fix-monitor-linking.patch | 41 +++
.../systemtap/systemtap/no-msgfmt-check.patch | 15 +
meta/recipes-kernel/systemtap/systemtap_git.inc | 2 +
.../don-t-default-to-cortex-a9-with-neon.patch | 13 +-
meta/recipes-multimedia/x264/x264_git.bb | 11 +-
...bKitMacros-Append-to-I-and-not-to-isystem.patch | 181 ----------
meta/recipes-sato/webkit/webkitgtk_2.14.1.bb | 4 +-
.../curl/{curl_7.50.1.bb => curl_7.51.0.bb} | 4 +-
meta/recipes-support/db/db_6.0.35.bb | 9 -
...001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch | 363 +++++++++++++++++++++
.../libbsd/libbsd/0002-Remove-funopen.patch | 55 ++++
...3-Fix-build-breaks-due-to-missing-a.out.h.patch | 130 ++++++++
meta/recipes-support/libbsd/libbsd_0.8.3.bb | 7 +
meta/recipes-support/libyaml/libyaml_0.1.7.bb | 2 +-
.../serf/{serf_1.3.8.bb => serf_1.3.9.bb} | 8 +-
.../target/arch/arm/conf/machine/machine.conf | 4 +-
.../target/arch/mips/conf/machine/machine.conf | 1 -
.../target/arch/mips64/conf/machine/machine.conf | 1 -
.../target/arch/powerpc/conf/machine/machine.conf | 1 -
.../target/arch/qemu/conf/machine/machine.conf | 3 -
scripts/lib/wic/canned-wks/systemd-bootdisk.wks | 2 +-
scripts/lib/wic/partition.py | 20 +-
scripts/lib/wic/plugins/source/bootimg-efi.py | 2 +-
scripts/lib/wic/plugins/source/rawcopy.py | 4 +-
scripts/lib/wic/utils/partitionedfs.py | 4 +-
scripts/oe-selftest | 13 +-
scripts/runqemu | 5 +-
74 files changed, 998 insertions(+), 714 deletions(-)
delete mode 100644 meta/lib/oeqa/selftest/kernel.py
delete mode 100644 meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
rename meta/recipes-connectivity/libpcap/{libpcap_1.7.4.bb => libpcap_1.8.1.bb} (67%)
create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch
rename meta/recipes-extended/gawk/{gawk-4.1.3 => gawk-4.1.4}/run-ptest (100%)
create mode 100644 meta/recipes-extended/gawk/gawk-4.1.4/test-arrayind1-Remove-hashbang-line.patch
rename meta/recipes-extended/gawk/{gawk_4.1.3.bb => gawk_4.1.4.bb} (85%)
rename meta/recipes-extended/grep/{grep_2.25.bb => grep_2.26.bb} (88%)
rename meta/recipes-extended/tzcode/{tzcode-native_2016h.bb => tzcode-native_2016i.bb} (69%)
rename meta/recipes-extended/tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} (98%)
delete mode 100644 meta/recipes-graphics/wayland/wayland/0001-scanner-Use-unit32_t-instead-of-uint.patch
rename meta/recipes-graphics/wayland/{wayland_1.11.1.bb => wayland_1.12.0.bb} (88%)
create mode 100644 meta/recipes-kernel/systemtap/systemtap/fix-monitor-linking.patch
create mode 100644 meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch
delete mode 100644 meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
rename meta/recipes-support/curl/{curl_7.50.1.bb => curl_7.51.0.bb} (94%)
create mode 100644 meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch
create mode 100644 meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch
create mode 100644 meta/recipes-support/libbsd/libbsd/0003-Fix-build-breaks-due-to-missing-a.out.h.patch
rename meta/recipes-support/serf/{serf_1.3.8.bb => serf_1.3.9.bb} (67%)
Alexander Kanavin (1):
maintainers.inc: remove libwnck3 recipe
Alistair Francis (1):
runqemu: Split out the base name of QB_DEFAULT_KERNEL
André Draszik (2):
image-buildinfo: treat staged changes as modified branch, too
cve-check.bbclass: CVE-2014-2524 / readline v5.2
Armin Kuster (2):
tzcode: update to 2016i
tzdata: update to 2016i
Brad Bishop (1):
libyaml: Enable nativesdk bake
Carlos Alberto Lopez Perez (1):
webkitgtk: drop patch
0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
Ed Bartosh (1):
systemd-bootdisk.wks: use PARTUUID
Fabio Berton (5):
serf: Update to version 1.3.9
grep: Update to version 2.26
curl: Update to version 7.51.0
gawk: Update to version 4.1.4
libpcap: Update to version 1.8.1
Fathi Boudra (1):
wayland: upgrade from 1.11.1 to 1.12.0
Jackie Huang (1):
classes/cpan-base: fix for PERLVERSION
Joe Konno (1):
initrdscripts: add support for NVME target install
Joshua Lock (5):
lib/oe/path: remove duplicate import
lib/oe/lsb: make the release dict keys consistent regardless of source
lib/oe/lsb: prefer /etc/os-release for distribution data
lib/oe/lsb: attempt to ensure consistent distro id regardless of
source
poky: update SANITY_TEST_DISTROS for new format
Jussi Kukkonen (1):
conf: Remove legacy X input drivers
Khem Raj (3):
libbsd: Fix build with musl
glibc-2.0: Detect pthread_getname_np() before use
x264: Update to latest on stable branch
Koen Kooi (1):
libbsd 0.8.3: BBCLASSEXTEND to native and nativesdk
Li Zhou (1):
db: disable the ARM assembler mutex code
Maciej Borzecki (5):
wic: make sure that partition size is always an integer in internal
processing
wic: use partition size when creating empty partition files
wic: check that filesystem is specified for a rootfs partition
wic: fix function comment typos
oe-selftest: fix handling of test cases without ID in --list-tests-by
Markus Lehtonen (1):
sanity.bbclass: fix logging of an error
Maxin B. John (1):
ref-images.xml: remove core-image-directfb reference
Richard Purdie (1):
chrpath: Remove standard search paths from RPATHS
Robert Yang (2):
qemuarm64.conf: make runqemu's graphics work
populate_sdk_ext.bbclass: check unfsd before create it
Ross Burton (6):
conf/distro/include/maintainers: move toolchain to Khem Raj
Revert "oeqa/selftest/kernel.py: Add new file destined for kernel
related tests"
distro_check: MeeGo is long dead, compare against Clear Linux instead
lib/oe/qa: handle binaries with segments outside the first 4kb
systemtap: remove explicit msgfmt check
systemtap: fix native linking on recent Ubuntu
Zubair Lutfullah Kakakhel (13):
arch-mips: Add o32 in TUNE_FEATURES for MIPS32R6
arch-mips: Add MACHINEOVERRIDES variables to reduce duplication
bitbake.conf: Reduce duplication in MIPS variants
fts: Reduce duplication in MIPS variants.
glibc: Reduce duplication in MIPS variants
packagegroup: Reduce duplication in MIPS variants.
gcc-runtime: Reduce duplication in MIPS variants.
gdb: Reduce duplication in MIPS variants.
mmc-utils: Reduce duplication in MIPS variants.
valgrind: Reduce duplication in MIPS variants.
ghostscript: Reduce duplication in MIPS variants.
mdadm: Reduce duplication in MIPS variants.
webkit: Reduce duplication in MIPS variants.
documentation/ref-manual/ref-images.xml | 3 -
meta-poky/conf/distro/include/maintainers.inc | 59 ++--
meta-poky/conf/distro/poky.conf | 24 +-
meta-yocto-bsp/conf/machine/beaglebone.conf | 4 +-
meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf | 1 -
meta/classes/chrpath.bbclass | 13 +-
meta/classes/cpan-base.bbclass | 2 +-
meta/classes/cve-check.bbclass | 2 +-
meta/classes/image-buildinfo.bbclass | 4 +-
meta/classes/populate_sdk_ext.bbclass | 5 +-
meta/classes/sanity.bbclass | 2 +-
meta/conf/bitbake.conf | 11 +-
meta/conf/machine/include/mips/README | 3 +
meta/conf/machine/include/mips/arch-mips.inc | 12 +
meta/conf/machine/include/tune-mips32r6.inc | 8 +-
meta/conf/machine/qemuarm64.conf | 2 +-
meta/lib/oe/distro_check.py | 16 +-
meta/lib/oe/lsb.py | 73 +++--
meta/lib/oe/path.py | 1 -
meta/lib/oe/qa.py | 82 ++---
meta/lib/oeqa/selftest/kernel.py | 29 --
meta/recipes-connectivity/libpcap/libpcap.inc | 5 +-
.../libpcap/libpcap/aclocal.patch | 167 ----------
.../libpcap/libpcap-pkgconfig-support.patch | 32 +-
.../libpcap/{libpcap_1.7.4.bb => libpcap_1.8.1.bb} | 13 +-
meta/recipes-core/fts/fts.bb | 5 +-
...st-for-pthread_getname_np-before-using-it.patch | 70 ++++
meta/recipes-core/glib-2.0/glib-2.0_2.50.1.bb | 1 +
meta/recipes-core/glibc/glibc-ld.inc | 17 +-
.../initrdscripts/files/init-install-efi.sh | 5 +-
.../initrdscripts/files/init-install.sh | 5 +-
.../packagegroups/packagegroup-core-sdk.bb | 5 +-
.../packagegroup-core-tools-profile.bb | 10 +-
meta/recipes-devtools/gcc/gcc-runtime.inc | 9 +-
meta/recipes-devtools/gdb/gdb-common.inc | 7 +-
meta/recipes-devtools/mmc/mmc-utils_git.bb | 4 +-
meta/recipes-devtools/valgrind/valgrind_3.12.0.bb | 3 +-
.../gawk/{gawk-4.1.3 => gawk-4.1.4}/run-ptest | 0
.../test-arrayind1-Remove-hashbang-line.patch | 30 ++
.../gawk/{gawk_4.1.3.bb => gawk_4.1.4.bb} | 5 +-
.../ghostscript/ghostscript_9.19.bb | 3 +-
.../grep/{grep_2.25.bb => grep_2.26.bb} | 4 +-
meta/recipes-extended/mdadm/mdadm_3.4.bb | 4 +-
...code-native_2016h.bb => tzcode-native_2016i.bb} | 8 +-
.../tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} | 4 +-
...0001-scanner-Use-unit32_t-instead-of-uint.patch | 30 --
.../{wayland_1.11.1.bb => wayland_1.12.0.bb} | 5 +-
.../systemtap/systemtap/fix-monitor-linking.patch | 41 +++
.../systemtap/systemtap/no-msgfmt-check.patch | 15 +
meta/recipes-kernel/systemtap/systemtap_git.inc | 2 +
.../don-t-default-to-cortex-a9-with-neon.patch | 13 +-
meta/recipes-multimedia/x264/x264_git.bb | 11 +-
...bKitMacros-Append-to-I-and-not-to-isystem.patch | 181 ----------
meta/recipes-sato/webkit/webkitgtk_2.14.1.bb | 4 +-
.../curl/{curl_7.50.1.bb => curl_7.51.0.bb} | 4 +-
meta/recipes-support/db/db_6.0.35.bb | 9 -
...001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch | 363 +++++++++++++++++++++
.../libbsd/libbsd/0002-Remove-funopen.patch | 55 ++++
...3-Fix-build-breaks-due-to-missing-a.out.h.patch | 130 ++++++++
meta/recipes-support/libbsd/libbsd_0.8.3.bb | 7 +
meta/recipes-support/libyaml/libyaml_0.1.7.bb | 2 +-
.../serf/{serf_1.3.8.bb => serf_1.3.9.bb} | 8 +-
.../target/arch/arm/conf/machine/machine.conf | 4 +-
.../target/arch/mips/conf/machine/machine.conf | 1 -
.../target/arch/mips64/conf/machine/machine.conf | 1 -
.../target/arch/powerpc/conf/machine/machine.conf | 1 -
.../target/arch/qemu/conf/machine/machine.conf | 3 -
scripts/lib/wic/canned-wks/systemd-bootdisk.wks | 2 +-
scripts/lib/wic/partition.py | 20 +-
scripts/lib/wic/plugins/source/bootimg-efi.py | 2 +-
scripts/lib/wic/plugins/source/rawcopy.py | 4 +-
scripts/lib/wic/utils/partitionedfs.py | 4 +-
scripts/oe-selftest | 13 +-
scripts/runqemu | 5 +-
74 files changed, 998 insertions(+), 714 deletions(-)
delete mode 100644 meta/lib/oeqa/selftest/kernel.py
delete mode 100644 meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
rename meta/recipes-connectivity/libpcap/{libpcap_1.7.4.bb => libpcap_1.8.1.bb} (67%)
create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch
rename meta/recipes-extended/gawk/{gawk-4.1.3 => gawk-4.1.4}/run-ptest (100%)
create mode 100644 meta/recipes-extended/gawk/gawk-4.1.4/test-arrayind1-Remove-hashbang-line.patch
rename meta/recipes-extended/gawk/{gawk_4.1.3.bb => gawk_4.1.4.bb} (85%)
rename meta/recipes-extended/grep/{grep_2.25.bb => grep_2.26.bb} (88%)
rename meta/recipes-extended/tzcode/{tzcode-native_2016h.bb => tzcode-native_2016i.bb} (69%)
rename meta/recipes-extended/tzdata/{tzdata_2016h.bb => tzdata_2016i.bb} (98%)
delete mode 100644 meta/recipes-graphics/wayland/wayland/0001-scanner-Use-unit32_t-instead-of-uint.patch
rename meta/recipes-graphics/wayland/{wayland_1.11.1.bb => wayland_1.12.0.bb} (88%)
create mode 100644 meta/recipes-kernel/systemtap/systemtap/fix-monitor-linking.patch
create mode 100644 meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch
delete mode 100644 meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
rename meta/recipes-support/curl/{curl_7.50.1.bb => curl_7.51.0.bb} (94%)
create mode 100644 meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch
create mode 100644 meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch
create mode 100644 meta/recipes-support/libbsd/libbsd/0003-Fix-build-breaks-due-to-missing-a.out.h.patch
rename meta/recipes-support/serf/{serf_1.3.8.bb => serf_1.3.9.bb} (67%)
--
2.8.1
^ permalink raw reply
* [PATCH 1/1] rpm: fix multilib macro installation
From: Chen Qi @ 2016-11-15 6:31 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <cover.1479191367.git.Qi.Chen@windriver.com>
For now, the rpm macro for multilib is not installed correctly. For
example, in x86-64 lib32 situation, the macro is installed under
tmp/work/x86-pokymllib32-linux/rpm/5.4.16-r0/image/usr/lib/rpm/poky/i686-linux/.
The directory is even not under WORKDIR. And it will of course not be
packaged.
We need to save necessary values before updating the localdata and restore
them so that the macros could be installed into the correct directory.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/recipes-devtools/rpm/rpm_5.4.16.bb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
index 85eb5fe..182818e 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -626,8 +626,9 @@ def multilib_rpmmacros(d):
localdata.delVar('TOOLCHAIN_OPTIONS')
# Set 'localdata' values to be consistent with 'd' values.
- localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
- localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
+ distromacrodirVal = d.getVar('distromacrodir', True)
+ workdirVal = d.getVar('WORKDIR', True)
+ dval = d.getVar('D', True)
ret = gen_arch_macro(localdata)
@@ -639,6 +640,9 @@ def multilib_rpmmacros(d):
localdata.setVar("OVERRIDES", overrides)
localdata.setVar("MLPREFIX", item + "-")
bb.data.update_data(localdata)
+ localdata.setVar('WORKDIR', workdirVal)
+ localdata.setVar('distromacrodir', distromacrodirVal)
+ localdata.setVar('D', dval)
ret += gen_arch_macro(localdata)
return ret
--
1.9.1
^ permalink raw reply related
* [PATCH 0/1] rpm: fix multilib macro installation
From: Chen Qi @ 2016-11-15 6:31 UTC (permalink / raw)
To: openembedded-core
The following changes since commit 9303d8055c45a0f6af295d70a6f6a8b9d8d8a7c9:
devtool: add "rename" subcommand (2016-11-07 11:04:17 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib ChenQi/rpm-macros
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/rpm-macros
Chen Qi (1):
rpm: fix multilib macro installation
meta/recipes-devtools/rpm/rpm_5.4.16.bb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--
1.9.1
^ permalink raw reply
* Re: [PATCH] devtool: fix handling of unicode characters from subprocess stdout
From: Hu, Jiajie @ 2016-11-15 5:44 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
In-Reply-To: <CAJTo0LaUcWr-=YvHBj=u+_yz0HtTS7HYWTAy6ggZjVi435La+Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]
I tried to follow the original implementation here. It seems that a simple read() is blocking and the output of the subprocess cannot be redirected in time. E.g., ‘Note: Fetching …’ is not shown until the unpack is finished.
From: Burton, Ross [mailto:ross.burton@intel.com]
Sent: Friday, November 11, 2016 8:22 PM
To: Hu, Jiajie <jiajie.hu@intel.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH] devtool: fix handling of unicode characters from subprocess stdout
On 11 November 2016 at 06:02, Jiajie Hu <jiajie.hu@intel.com<mailto:jiajie.hu@intel.com>> wrote:
+ reader = codecs.getreader('utf-8')(process.stdout)
buf = ''
while True:
- out = process.stdout.read(1)
- out = out.decode('utf-8')
+ out = reader.read(1, 1)
A reader is definitely the right thing here, but I'm wondering why this needs to loop on single characters. As I understand it doing a read() on a reader wrapping stdout will read until it blocks (because the process hasn't got anything to output) so result in less pointless iterating.
Ross
[-- Attachment #2: Type: text/html, Size: 4337 bytes --]
^ permalink raw reply
* [PATCH V3] devshell: list commands when throwing NoSupportedTerminals
From: Stephano Cetola @ 2016-11-15 2:30 UTC (permalink / raw)
To: openembedded-core
In-Reply-To: <20161115023011.85782-1-stephano.cetola@linux.intel.com>
When attempting to run devshell, if no terminal is available, the
error being thrown was not very specific. This adds a list of
commands that failed, informing the user of what they can install to
fix the error.
[ YOCTO #10472]
Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
---
meta/classes/terminal.bbclass | 8 ++++++--
meta/lib/oe/terminal.py | 13 +++++++++++--
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index a94f755..cd8d124 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -88,8 +88,12 @@ def oe_terminal(command, title, d):
try:
oe.terminal.spawn_preferred(command, title, None, d)
- except oe.terminal.NoSupportedTerminals:
- bb.fatal('No valid terminal found, unable to open devshell')
+ except oe.terminal.NoSupportedTerminals as nosup:
+ nosup.terms.remove("false")
+ cmds = '\n\t'.join(nosup.terms).replace("{command}",
+ "do_terminal").replace("{title}", title)
+ bb.fatal('No valid terminal found, unable to open devshell.\n' +
+ 'Tried the following commands:\n\t%s' % cmds)
except oe.terminal.ExecutionError as exc:
bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 7446c44..38e66ce 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -11,7 +11,8 @@ class UnsupportedTerminal(Exception):
pass
class NoSupportedTerminals(Exception):
- pass
+ def __init__(self, terms):
+ self.terms = terms
class Registry(oe.classutils.ClassRegistry):
@@ -209,6 +210,14 @@ class Custom(Terminal):
def prioritized():
return Registry.prioritized()
+def get_cmd_list():
+ terms = Registry.prioritized()
+ cmds = []
+ for term in terms:
+ if term.command:
+ cmds.append(term.command)
+ return cmds
+
def spawn_preferred(sh_cmd, title=None, env=None, d=None):
"""Spawn the first supported terminal, by priority"""
for terminal in prioritized():
@@ -218,7 +227,7 @@ def spawn_preferred(sh_cmd, title=None, env=None, d=None):
except UnsupportedTerminal:
continue
else:
- raise NoSupportedTerminals()
+ raise NoSupportedTerminals(get_cmd_list())
def spawn(name, sh_cmd, title=None, env=None, d=None):
"""Spawn the specified terminal, by name"""
--
2.10.2
^ permalink raw reply related
* [PATCH V3] devshell: list commands when throwing NoSupportedTerminals
From: Stephano Cetola @ 2016-11-15 2:30 UTC (permalink / raw)
To: openembedded-core
Changes since V2:
add yocto bug number
Stephano Cetola (1):
devshell: list commands when throwing NoSupportedTerminals
meta/classes/terminal.bbclass | 8 ++++++--
meta/lib/oe/terminal.py | 13 +++++++++++--
2 files changed, 17 insertions(+), 4 deletions(-)
--
2.10.2
^ permalink raw reply
* [PATCH] recipetool: add postinst to .deb import
From: Stephano Cetola @ 2016-11-15 2:26 UTC (permalink / raw)
To: openembedded-core
The .deb import feature did not import postinst, postrm, preinst, or¬
prerm functions. This change checks to see if those files exist, and
if so, adds the appropriate functions adding correct path variables
if¬ required.¬
[ YOCTO #10421 ]
Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
---
scripts/lib/recipetool/create.py | 36 +++++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index cb1c804..8dc06ef 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -234,7 +234,8 @@ class RecipeHandler(object):
if deps:
values['DEPENDS'] = ' '.join(deps)
- def genfunction(self, outlines, funcname, content, python=False, forcespace=False):
+ @staticmethod
+ def genfunction(outlines, funcname, content, python=False, forcespace=False):
if python:
prefix = 'python '
else:
@@ -460,8 +461,8 @@ def create_recipe(args):
if pkgfile:
if pkgfile.endswith(('.deb', '.ipk')):
- stdout, _ = bb.process.run('ar x %s control.tar.gz' % pkgfile, cwd=tmpfdir)
- stdout, _ = bb.process.run('tar xf control.tar.gz ./control', cwd=tmpfdir)
+ stdout, _ = bb.process.run('ar x %s' % pkgfile, cwd=tmpfdir)
+ stdout, _ = bb.process.run('tar xf control.tar.gz', cwd=tmpfdir)
values = convert_debian(tmpfdir)
extravalues.update(values)
elif pkgfile.endswith(('.rpm', '.srpm')):
@@ -722,6 +723,15 @@ def create_recipe(args):
if not bbclassextend:
lines_after.append('BBCLASSEXTEND = "native"')
+ postinst = ("postinst", extravalues.pop('postinst', None))
+ postrm = ("postrm", extravalues.pop('postrm', None))
+ preinst = ("preinst", extravalues.pop('preinst', None))
+ prerm = ("prerm", extravalues.pop('prerm', None))
+ funcs = [postinst, postrm, preinst, prerm]
+ for func in funcs:
+ if func[1]:
+ RecipeHandler.genfunction(lines_after, 'pkg_%s_${PN}' % func[0], func[1])
+
outlines = []
outlines.extend(lines_before)
if classes:
@@ -1058,6 +1068,26 @@ def convert_debian(debpath):
varname = value_map.get(key, None)
if varname:
values[varname] = value
+ postinst = os.path.join(debpath, 'postinst')
+ postrm = os.path.join(debpath, 'postrm')
+ preinst = os.path.join(debpath, 'preinst')
+ prerm = os.path.join(debpath, 'prerm')
+ sfiles = [postinst, postrm, preinst, prerm]
+ isPath = [" /", "'/", '"/']
+ for sfile in sfiles:
+ if os.path.isfile(sfile):
+ logger.info("Converting %s file to recipe function..." %
+ os.path.basename(sfile).upper())
+ content = []
+ with open(sfile) as f:
+ for line in f:
+ if "#!/" in line:
+ continue
+ line = line.rstrip("\n")
+ if line.strip():
+ content.append(line)
+ if content:
+ values[os.path.basename(f.name)] = content
#if depends:
# values['DEPENDS'] = ' '.join(depends)
--
2.10.2
^ permalink raw reply related
* Re: [PATCH] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests
From: Benjamin Esquivel @ 2016-11-15 0:31 UTC (permalink / raw)
To: 'Jose Perez Carranza', openembedded-core; +Cc: paul.eggleton
In-Reply-To: <ea7fee7c-333c-2e14-fb70-fff4c79f7098@linux.intel.com>
> -----Original Message-----
> From: Jose Perez Carranza [mailto:jose.perez.carranza@linux.intel.com]
> Sent: Thursday, November 10, 2016 4:40 PM
> To: benjamin.esquivel@linux.intel.com; openembedded-
> core@lists.openembedded.org
> Cc: paul.eggleton@intel.com
> Subject: Re: [OE-core] [PATCH] oe-tests: Migrate tests from /oe/test to
> /oeqa/selftest/oe-tests
>
> On 11/03/2016 06:12 PM, Benjamin Esquivel wrote:
> > Hello José, a couple of comments below.
> >
> > On Thu, 2016-11-03 at 17:46 -0500, jose.perez.carranza@linux.intel.com
> > wrote:
> >> From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
> >>
> >> Currently the unittests for scripts on meta/lib/oe are not being
> >> executed by any suite hence the best option is migrate them to
> >> meta/lib/oeqa/selftest to be executed along with the selftest suite.
> >>
> > How much more time do these tests add to a selftest execution?
> Those test cases runs very fast, in about 1 minute all of them
> >> [YOCTO #7376]
> >>
> >> Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.c
> >> om>
> >> ---
> >> meta/lib/oe/tests/__init__.py | 0
> >> meta/lib/oe/tests/test_elf.py | 21 -------
> >> meta/lib/oe/tests/test_license.py | 68 -----------------
> >> -----
> >> meta/lib/oe/tests/test_path.py | 89 -----------------
> >> -----------
> >> meta/lib/oe/tests/test_types.py | 62 -----------------
> >> ---
> >> meta/lib/oe/tests/test_utils.py | 51 ----------------
> >> meta/lib/oeqa/selftest/oe_tests/__init__.py | 0
> >> meta/lib/oeqa/selftest/oe_tests/elf.py | 22 +++++++
> >> meta/lib/oeqa/selftest/oe_tests/license.py | 69
> >> ++++++++++++++++++++++
> >> meta/lib/oeqa/selftest/oe_tests/path.py | 90
> >> +++++++++++++++++++++++++++++
> >> meta/lib/oeqa/selftest/oe_tests/types.py | 61
> +++++++++++++++++++
> >> meta/lib/oeqa/selftest/oe_tests/utils.py | 52 +++++++++++++++++
> >> 12 files changed, 294 insertions(+), 291 deletions(-)
> >> delete mode 100644 meta/lib/oe/tests/__init__.py
> >> delete mode 100644 meta/lib/oe/tests/test_elf.py
> >> delete mode 100644 meta/lib/oe/tests/test_license.py
> >> delete mode 100644 meta/lib/oe/tests/test_path.py
> >> delete mode 100644 meta/lib/oe/tests/test_types.py
> >> delete mode 100644 meta/lib/oe/tests/test_utils.py
> >> create mode 100644 meta/lib/oeqa/selftest/oe_tests/__init__.py
> > selftest has no other dir in it and this dir name of oe_test makes
> > little sense if you see it in the context of oeqa/selftest/oe_test. I
> > suggest using a dir name that brings some additional info as to what
> > is inside of it or try and see how to integrate these tests into the
> > selftest/ plain structure.
> integrate on the root of selftest is easy but I don't know if its the best option
> as those test are very specific unit test for scripts that are under meta/lib/oe
> that is why I used oe_test/ . Do you have any suggestion on the name of the
> dir?
I would suggest to land the tests in: meta/lib/oeqa/selftest/oelib-tests
> >> create mode 100644 meta/lib/oeqa/selftest/oe_tests/elf.py
> >> create mode 100644 meta/lib/oeqa/selftest/oe_tests/license.py
> >> create mode 100644 meta/lib/oeqa/selftest/oe_tests/path.py
> >> create mode 100644 meta/lib/oeqa/selftest/oe_tests/types.py
> >> create mode 100644 meta/lib/oeqa/selftest/oe_tests/utils.py
> >>
> >> diff --git a/meta/lib/oe/tests/__init__.py
> >> b/meta/lib/oe/tests/__init__.py deleted file mode 100644 index
> >> e69de29..0000000 diff --git a/meta/lib/oe/tests/test_elf.py
> >> b/meta/lib/oe/tests/test_elf.py deleted file mode 100644 index
> >> 1f59037..0000000
> >> --- a/meta/lib/oe/tests/test_elf.py
> >> +++ /dev/null
> >> @@ -1,21 +0,0 @@
> >> -import unittest
> >> -import oe.qa
> >> -
> >> -class TestElf(unittest.TestCase):
> >> - def test_machine_name(self):
> >> - """
> >> - Test elf_machine_to_string()
> >> - """
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x14),
> >> "PowerPC")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x2A),
> >> "SuperH")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-
> >> 64")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0xB7),
> >> "AArch64")
> >> -
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown
> >> (0)")
> >> - self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF),
> >> "Unknown (3735928559)")
> >> - self.assertEqual(oe.qa.elf_machine_to_string("foobar"),
> >> "Unknown ('foobar')")
> >> diff --git a/meta/lib/oe/tests/test_license.py
> >> b/meta/lib/oe/tests/test_license.py
> >> deleted file mode 100644
> >> index c388886..0000000
> >> --- a/meta/lib/oe/tests/test_license.py
> >> +++ /dev/null
> >> @@ -1,68 +0,0 @@
> >> -import unittest
> >> -import oe.license
> >> -
> >> -class SeenVisitor(oe.license.LicenseVisitor):
> >> - def __init__(self):
> >> - self.seen = []
> >> - oe.license.LicenseVisitor.__init__(self)
> >> -
> >> - def visit_Str(self, node):
> >> - self.seen.append(node.s)
> >> -
> >> -class TestSingleLicense(unittest.TestCase):
> >> - licenses = [
> >> - "GPLv2",
> >> - "LGPL-2.0",
> >> - "Artistic",
> >> - "MIT",
> >> - "GPLv3+",
> >> - "FOO_BAR",
> >> - ]
> >> - invalid_licenses = ["GPL/BSD"]
> >> -
> >> - @staticmethod
> >> - def parse(licensestr):
> >> - visitor = SeenVisitor()
> >> - visitor.visit_string(licensestr)
> >> - return visitor.seen
> >> -
> >> - def test_single_licenses(self):
> >> - for license in self.licenses:
> >> - licenses = self.parse(license)
> >> - self.assertListEqual(licenses, [license])
> >> -
> >> - def test_invalid_licenses(self):
> >> - for license in self.invalid_licenses:
> >> - with self.assertRaises(oe.license.InvalidLicense) as cm:
> >> - self.parse(license)
> >> - self.assertEqual(cm.exception.license, license)
> >> -
> >> -class TestSimpleCombinations(unittest.TestCase):
> >> - tests = {
> >> - "FOO&BAR": ["FOO", "BAR"],
> >> - "BAZ & MOO": ["BAZ", "MOO"],
> >> - "ALPHA|BETA": ["ALPHA"],
> >> - "BAZ&MOO|FOO": ["FOO"],
> >> - "FOO&BAR|BAZ": ["FOO", "BAR"],
> >> - }
> >> - preferred = ["ALPHA", "FOO", "BAR"]
> >> -
> >> - def test_tests(self):
> >> - def choose(a, b):
> >> - if all(lic in self.preferred for lic in b):
> >> - return b
> >> - else:
> >> - return a
> >> -
> >> - for license, expected in self.tests.items():
> >> - licenses = oe.license.flattened_licenses(license,
> >> choose)
> >> - self.assertListEqual(licenses, expected)
> >> -
> >> -class TestComplexCombinations(TestSimpleCombinations):
> >> - tests = {
> >> - "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
> >> - "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
> >> - "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
> >> - "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-
> >> 4-clause", "MIT"],
> >> - }
> >> - preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
> >> diff --git a/meta/lib/oe/tests/test_path.py
> >> b/meta/lib/oe/tests/test_path.py deleted file mode 100644 index
> >> 44d0681..0000000
> >> --- a/meta/lib/oe/tests/test_path.py
> >> +++ /dev/null
> >> @@ -1,89 +0,0 @@
> >> -import unittest
> >> -import oe, oe.path
> >> -import tempfile
> >> -import os
> >> -import errno
> >> -import shutil
> >> -
> >> -class TestRealPath(unittest.TestCase):
> >> - DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX",
> >> "usr/sbin", "usr/include", "usr/include/gdbm" ]
> >> - FILES = [ "etc/passwd", "b/file" ]
> >> - LINKS = [
> >> - ( "bin", "/usr/bin", "/usr/bin" ),
> >> - ( "binX", "usr/binX", "/usr/binX" ),
> >> - ( "c", "broken", "/broken" ),
> >> - ( "etc/passwd-1", "passwd", "/etc/passwd"
> >> ),
> >> - ( "etc/passwd-2", "passwd-1", "/etc/passwd"
> >> ),
> >> - ( "etc/passwd-3", "/etc/passwd-1", "/etc/passwd"
> >> ),
> >> - ( "etc/shadow-1", "/etc/shadow", "/etc/shadow"
> >> ),
> >> - ( "etc/shadow-2", "/etc/shadow-1", "/etc/shadow"
> >> ),
> >> - ( "prog-A", "bin/prog-A", "/usr/bin/prog-
> >> A" ),
> >> - ( "prog-B", "/bin/prog-B", "/usr/bin/prog-
> >> B" ),
> >> - ( "usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C"
> >> ),
> >> - ( "usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D"
> >> ),
> >> - ( "usr/binX/prog-E", "../sbin/prog-E", None ),
> >> - ( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F"
> >> ),
> >> - ( "loop", "a/loop", None ),
> >> - ( "a/loop", "../loop", None ),
> >> - ( "b/test", "file/foo", "/b/file/foo"
> >> ),
> >> - ]
> >> -
> >> - LINKS_PHYS = [
> >> - ( "./", "/", "" ),
> >> - ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
> >> - ]
> >> -
> >> - EXCEPTIONS = [
> >> - ( "loop", errno.ELOOP ),
> >> - ( "b/test", errno.ENOENT ),
> >> - ]
> >> -
> >> - def __del__(self):
> >> - try:
> >> - #os.system("tree -F %s" % self.tmpdir)
> >> - shutil.rmtree(self.tmpdir)
> >> - except:
> >> - pass
> >> -
> >> - def setUp(self):
> >> - self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
> >> - self.root = os.path.join(self.tmpdir, "R")
> >> -
> >> - os.mkdir(os.path.join(self.tmpdir, "_real"))
> >> - os.symlink("_real", self.root)
> >> -
> >> - for d in self.DIRS:
> >> - os.mkdir(os.path.join(self.root, d))
> >> - for f in self.FILES:
> >> - open(os.path.join(self.root, f), "w")
> >> - for l in self.LINKS:
> >> - os.symlink(l[1], os.path.join(self.root, l[0]))
> >> -
> >> - def __realpath(self, file, use_physdir, assume_dir = True):
> >> - return oe.path.realpath(os.path.join(self.root, file),
> >> self.root,
> >> - use_physdir, assume_dir =
> >> assume_dir)
> >> -
> >> - def test_norm(self):
> >> - for l in self.LINKS:
> >> - if l[2] == None:
> >> - continue
> >> -
> >> - target_p = self.__realpath(l[0], True)
> >> - target_l = self.__realpath(l[0], False)
> >> -
> >> - if l[2] != False:
> >> - self.assertEqual(target_p, target_l)
> >> - self.assertEqual(l[2], target_p[len(self.root):])
> >> -
> >> - def test_phys(self):
> >> - for l in self.LINKS_PHYS:
> >> - target_p = self.__realpath(l[0], True)
> >> - target_l = self.__realpath(l[0], False)
> >> -
> >> - self.assertEqual(l[1], target_p[len(self.root):])
> >> - self.assertEqual(l[2], target_l[len(self.root):])
> >> -
> >> - def test_loop(self):
> >> - for e in self.EXCEPTIONS:
> >> - self.assertRaisesRegex(OSError, r'\[Errno %u\]' % e[1],
> >> - self.__realpath, e[0], False,
> >> False)
> >> diff --git a/meta/lib/oe/tests/test_types.py
> >> b/meta/lib/oe/tests/test_types.py deleted file mode 100644 index
> >> 367cc30..0000000
> >> --- a/meta/lib/oe/tests/test_types.py
> >> +++ /dev/null
> >> @@ -1,62 +0,0 @@
> >> -import unittest
> >> -from oe.maketype import create, factory
> >> -
> >> -class TestTypes(unittest.TestCase):
> >> - def assertIsInstance(self, obj, cls):
> >> - return self.assertTrue(isinstance(obj, cls))
> >> -
> >> - def assertIsNot(self, obj, other):
> >> - return self.assertFalse(obj is other)
> >> -
> >> - def assertFactoryCreated(self, value, type, **flags):
> >> - cls = factory(type)
> >> - self.assertIsNot(cls, None)
> >> - self.assertIsInstance(create(value, type, **flags), cls)
> >> -
> >> -class TestBooleanType(TestTypes):
> >> - def test_invalid(self):
> >> - self.assertRaises(ValueError, create, '', 'boolean')
> >> - self.assertRaises(ValueError, create, 'foo', 'boolean')
> >> - self.assertRaises(TypeError, create, object(), 'boolean')
> >> -
> >> - def test_true(self):
> >> - self.assertTrue(create('y', 'boolean'))
> >> - self.assertTrue(create('yes', 'boolean'))
> >> - self.assertTrue(create('1', 'boolean'))
> >> - self.assertTrue(create('t', 'boolean'))
> >> - self.assertTrue(create('true', 'boolean'))
> >> - self.assertTrue(create('TRUE', 'boolean'))
> >> - self.assertTrue(create('truE', 'boolean'))
> >> -
> >> - def test_false(self):
> >> - self.assertFalse(create('n', 'boolean'))
> >> - self.assertFalse(create('no', 'boolean'))
> >> - self.assertFalse(create('0', 'boolean'))
> >> - self.assertFalse(create('f', 'boolean'))
> >> - self.assertFalse(create('false', 'boolean'))
> >> - self.assertFalse(create('FALSE', 'boolean'))
> >> - self.assertFalse(create('faLse', 'boolean'))
> >> -
> >> - def test_bool_equality(self):
> >> - self.assertEqual(create('n', 'boolean'), False)
> >> - self.assertNotEqual(create('n', 'boolean'), True)
> >> - self.assertEqual(create('y', 'boolean'), True)
> >> - self.assertNotEqual(create('y', 'boolean'), False)
> >> -
> >> -class TestList(TestTypes):
> >> - def assertListEqual(self, value, valid, sep=None):
> >> - obj = create(value, 'list', separator=sep)
> >> - self.assertEqual(obj, valid)
> >> - if sep is not None:
> >> - self.assertEqual(obj.separator, sep)
> >> - self.assertEqual(str(obj), obj.separator.join(obj))
> >> -
> >> - def test_list_nosep(self):
> >> - testlist = ['alpha', 'beta', 'theta']
> >> - self.assertListEqual('alpha beta theta', testlist)
> >> - self.assertListEqual('alpha beta\ttheta', testlist)
> >> - self.assertListEqual('alpha', ['alpha'])
> >> -
> >> - def test_list_usersep(self):
> >> - self.assertListEqual('foo:bar', ['foo', 'bar'], ':')
> >> - self.assertListEqual('foo:bar:baz', ['foo', 'bar', 'baz'],
> >> ':')
> >> diff --git a/meta/lib/oe/tests/test_utils.py
> >> b/meta/lib/oe/tests/test_utils.py deleted file mode 100644 index
> >> 5d9ac52..0000000
> >> --- a/meta/lib/oe/tests/test_utils.py
> >> +++ /dev/null
> >> @@ -1,51 +0,0 @@
> >> -import unittest
> >> -from oe.utils import packages_filter_out_system
> >> -
> >> -class TestPackagesFilterOutSystem(unittest.TestCase):
> >> - def test_filter(self):
> >> - """
> >> - Test that oe.utils.packages_filter_out_system works.
> >> - """
> >> - try:
> >> - import bb
> >> - except ImportError:
> >> - self.skipTest("Cannot import bb")
> >> -
> >> - d = bb.data_smart.DataSmart()
> >> - d.setVar("PN", "foo")
> >> -
> >> - d.setVar("PACKAGES", "foo foo-doc foo-dev")
> >> - pkgs = packages_filter_out_system(d)
> >> - self.assertEqual(pkgs, [])
> >> -
> >> - d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
> >> - pkgs = packages_filter_out_system(d)
> >> - self.assertEqual(pkgs, ["foo-data"])
> >> -
> >> - d.setVar("PACKAGES", "foo foo-locale-en-gb")
> >> - pkgs = packages_filter_out_system(d)
> >> - self.assertEqual(pkgs, [])
> >> -
> >> - d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
> >> - pkgs = packages_filter_out_system(d)
> >> - self.assertEqual(pkgs, ["foo-data"])
> >> -
> >> -
> >> -class TestTrimVersion(unittest.TestCase):
> >> - def test_version_exception(self):
> >> - with self.assertRaises(TypeError):
> >> - trim_version(None, 2)
> >> - with self.assertRaises(TypeError):
> >> - trim_version((1, 2, 3), 2)
> >> -
> >> - def test_num_exception(self):
> >> - with self.assertRaises(ValueError):
> >> - trim_version("1.2.3", 0)
> >> - with self.assertRaises(ValueError):
> >> - trim_version("1.2.3", -1)
> >> -
> >> - def test_valid(self):
> >> - self.assertEqual(trim_version("1.2.3", 1), "1")
> >> - self.assertEqual(trim_version("1.2.3", 2), "1.2")
> >> - self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
> >> - self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
> >> diff --git a/meta/lib/oeqa/selftest/oe_tests/__init__.py
> >> b/meta/lib/oeqa/selftest/oe_tests/__init__.py
> >> new file mode 100644
> >> index 0000000..e69de29
> >> diff --git a/meta/lib/oeqa/selftest/oe_tests/elf.py
> >> b/meta/lib/oeqa/selftest/oe_tests/elf.py
> >> new file mode 100644
> >> index 0000000..582d772
> >> --- /dev/null
> >> +++ b/meta/lib/oeqa/selftest/oe_tests/elf.py
> >> @@ -0,0 +1,22 @@
> >> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.decorators
> >> +import testcase import oe.qa
> >> +
> >> +class TestElf(oeSelfTest):
> >> + def test_machine_name(self):
> >> + """
> >> + Test elf_machine_to_string()
> >> + """
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x14),
> >> "PowerPC")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x2A),
> >> "SuperH")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-
> >> 64")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0xB7),
> >> "AArch64")
> >> +
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown
> >> (0)")
> >> + self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF),
> >> "Unknown (3735928559)")
> >> + self.assertEqual(oe.qa.elf_machine_to_string("foobar"),
> >> "Unknown ('foobar')")
> >> diff --git a/meta/lib/oeqa/selftest/oe_tests/license.py
> >> b/meta/lib/oeqa/selftest/oe_tests/license.py
> >> new file mode 100644
> >> index 0000000..90bdf51
> >> --- /dev/null
> >> +++ b/meta/lib/oeqa/selftest/oe_tests/license.py
> >> @@ -0,0 +1,69 @@
> >> +import oe.license
> >> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.decorators
> >> +import testcase
> >> +
> >> +class SeenVisitor(oe.license.LicenseVisitor):
> >> + def __init__(self):
> >> + self.seen = []
> >> + oe.license.LicenseVisitor.__init__(self)
> >> +
> >> + def visit_Str(self, node):
> >> + self.seen.append(node.s)
> >> +
> >> +class TestSingleLicense(oeSelfTest):
> >> + licenses = [
> >> + "GPLv2",
> >> + "LGPL-2.0",
> >> + "Artistic",
> >> + "MIT",
> >> + "GPLv3+",
> >> + "FOO_BAR",
> >> + ]
> >> + invalid_licenses = ["GPL/BSD"]
> >> +
> >> + @staticmethod
> >> + def parse(licensestr):
> >> + visitor = SeenVisitor()
> >> + visitor.visit_string(licensestr)
> >> + return visitor.seen
> >> +
> >> + def test_single_licenses(self):
> >> + for license in self.licenses:
> >> + licenses = self.parse(license)
> >> + self.assertListEqual(licenses, [license])
> >> +
> >> + def test_invalid_licenses(self):
> >> + for license in self.invalid_licenses:
> >> + with self.assertRaises(oe.license.InvalidLicense) as cm:
> >> + self.parse(license)
> >> + self.assertEqual(cm.exception.license, license)
> >> +
> >> +class TestSimpleCombinations(oeSelfTest):
> >> + tests = {
> >> + "FOO&BAR": ["FOO", "BAR"],
> >> + "BAZ & MOO": ["BAZ", "MOO"],
> >> + "ALPHA|BETA": ["ALPHA"],
> >> + "BAZ&MOO|FOO": ["FOO"],
> >> + "FOO&BAR|BAZ": ["FOO", "BAR"],
> >> + }
> >> + preferred = ["ALPHA", "FOO", "BAR"]
> >> +
> >> + def test_tests(self):
> >> + def choose(a, b):
> >> + if all(lic in self.preferred for lic in b):
> >> + return b
> >> + else:
> >> + return a
> >> +
> >> + for license, expected in self.tests.items():
> >> + licenses = oe.license.flattened_licenses(license,
> >> choose)
> >> + self.assertListEqual(licenses, expected)
> >> +
> >> +class TestComplexCombinations(TestSimpleCombinations):
> >> + tests = {
> >> + "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
> >> + "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
> >> + "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
> >> + "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-
> >> 4-clause", "MIT"],
> >> + }
> >> + preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
> >> diff --git a/meta/lib/oeqa/selftest/oe_tests/path.py
> >> b/meta/lib/oeqa/selftest/oe_tests/path.py
> >> new file mode 100644
> >> index 0000000..09b56cb
> >> --- /dev/null
> >> +++ b/meta/lib/oeqa/selftest/oe_tests/path.py
> >> @@ -0,0 +1,90 @@
> >> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.decorators
> >> +import testcase import oe, oe.path import tempfile import os import
> >> +errno import shutil
> >> +
> >> +class TestRealPath(oeSelfTest):
> >> + DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX",
> >> "usr/sbin", "usr/include", "usr/include/gdbm" ]
> >> + FILES = [ "etc/passwd", "b/file" ]
> >> + LINKS = [
> >> + ( "bin", "/usr/bin", "/usr/bin" ),
> >> + ( "binX", "usr/binX", "/usr/binX" ),
> >> + ( "c", "broken", "/broken" ),
> >> + ( "etc/passwd-1", "passwd", "/etc/passwd"
> >> ),
> >> + ( "etc/passwd-2", "passwd-1", "/etc/passwd"
> >> ),
> >> + ( "etc/passwd-3", "/etc/passwd-1", "/etc/passwd"
> >> ),
> >> + ( "etc/shadow-1", "/etc/shadow", "/etc/shadow"
> >> ),
> >> + ( "etc/shadow-2", "/etc/shadow-1", "/etc/shadow"
> >> ),
> >> + ( "prog-A", "bin/prog-A", "/usr/bin/prog-
> >> A" ),
> >> + ( "prog-B", "/bin/prog-B", "/usr/bin/prog-
> >> B" ),
> >> + ( "usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C"
> >> ),
> >> + ( "usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D"
> >> ),
> >> + ( "usr/binX/prog-E", "../sbin/prog-E", None ),
> >> + ( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F"
> >> ),
> >> + ( "loop", "a/loop", None ),
> >> + ( "a/loop", "../loop", None ),
> >> + ( "b/test", "file/foo", "/b/file/foo"
> >> ),
> >> + ]
> >> +
> >> + LINKS_PHYS = [
> >> + ( "./", "/", "" ),
> >> + ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
> >> + ]
> >> +
> >> + EXCEPTIONS = [
> >> + ( "loop", errno.ELOOP ),
> >> + ( "b/test", errno.ENOENT ),
> >> + ]
> >> +
> >> + def __del__(self):
> >> + try:
> >> + #os.system("tree -F %s" % self.tmpdir)
> >> + shutil.rmtree(self.tmpdir)
> >> + except:
> >> + pass
> >> +
> >> + def setUp(self):
> >> + self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
> >> + self.root = os.path.join(self.tmpdir, "R")
> >> +
> >> + os.mkdir(os.path.join(self.tmpdir, "_real"))
> >> + os.symlink("_real", self.root)
> >> +
> >> + for d in self.DIRS:
> >> + os.mkdir(os.path.join(self.root, d))
> >> + for f in self.FILES:
> >> + open(os.path.join(self.root, f), "w")
> >> + for l in self.LINKS:
> >> + os.symlink(l[1], os.path.join(self.root, l[0]))
> >> +
> >> + def __realpath(self, file, use_physdir, assume_dir = True):
> >> + return oe.path.realpath(os.path.join(self.root, file),
> >> self.root,
> >> + use_physdir, assume_dir =
> >> assume_dir)
> >> +
> >> + def test_norm(self):
> >> + for l in self.LINKS:
> >> + if l[2] == None:
> >> + continue
> >> +
> >> + target_p = self.__realpath(l[0], True)
> >> + target_l = self.__realpath(l[0], False)
> >> +
> >> + if l[2] != False:
> >> + self.assertEqual(target_p, target_l)
> >> + self.assertEqual(l[2], target_p[len(self.root):])
> >> +
> >> + def test_phys(self):
> >> + for l in self.LINKS_PHYS:
> >> + target_p = self.__realpath(l[0], True)
> >> + target_l = self.__realpath(l[0], False)
> >> +
> >> + self.assertEqual(l[1], target_p[len(self.root):])
> >> + self.assertEqual(l[2], target_l[len(self.root):])
> >> +
> >> + def test_loop(self):
> >> + for e in self.EXCEPTIONS:
> >> + self.assertRaisesRegex(OSError, r'\[Errno %u\]' % e[1],
> >> + self.__realpath, e[0], False,
> >> False)
> >> diff --git a/meta/lib/oeqa/selftest/oe_tests/types.py
> >> b/meta/lib/oeqa/selftest/oe_tests/types.py
> >> new file mode 100644
> >> index 0000000..2613da9
> >> --- /dev/null
> >> +++ b/meta/lib/oeqa/selftest/oe_tests/types.py
> >> @@ -0,0 +1,61 @@
> >> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.decorators
> >> +import testcase from oe.maketype import create, factory
> >> +
> >> +class TestTypes(oeSelfTest):
> >> + def assertIsInstance(self, obj, cls):
> >> + return self.assertTrue(isinstance(obj, cls))
> >> +
> >> + def assertIsNot(self, obj, other):
> >> + return self.assertFalse(obj is other)
> >> +
> >> + def assertFactoryCreated(self, value, type, **flags):
> >> + cls = factory(type)
> >> + self.assertIsNot(cls, None)
> >> + self.assertIsInstance(create(value, type, **flags), cls)
> >> +
> >> + def assertListIsEqual(self, value, valid, sep=None):
> >> + obj = create(value, 'list', separator=sep)
> >> + self.assertListEqual(obj, valid)
> >> +
> >> +class TestBooleanType(TestTypes):
> >> + def test_invalid(self):
> >> + self.assertRaises(ValueError, create, '', 'boolean')
> >> + self.assertRaises(ValueError, create, 'foo', 'boolean')
> >> + self.assertRaises(TypeError, create, object(), 'boolean')
> >> +
> >> + def test_true(self):
> >> + self.assertTrue(create('y', 'boolean'))
> >> + self.assertTrue(create('yes', 'boolean'))
> >> + self.assertTrue(create('1', 'boolean'))
> >> + self.assertTrue(create('t', 'boolean'))
> >> + self.assertTrue(create('true', 'boolean'))
> >> + self.assertTrue(create('TRUE', 'boolean'))
> >> + self.assertTrue(create('truE', 'boolean'))
> >> +
> >> + def test_false(self):
> >> + self.assertFalse(create('n', 'boolean'))
> >> + self.assertFalse(create('no', 'boolean'))
> >> + self.assertFalse(create('0', 'boolean'))
> >> + self.assertFalse(create('f', 'boolean'))
> >> + self.assertFalse(create('false', 'boolean'))
> >> + self.assertFalse(create('FALSE', 'boolean'))
> >> + self.assertFalse(create('faLse', 'boolean'))
> >> +
> >> + def test_bool_equality(self):
> >> + self.assertEqual(create('n', 'boolean'), False)
> >> + self.assertNotEqual(create('n', 'boolean'), True)
> >> + self.assertEqual(create('y', 'boolean'), True)
> >> + self.assertNotEqual(create('y', 'boolean'), False)
> >> +
> >> +class TestList(TestTypes):
> >> +
> >> + def test_list_nosep(self):
> >> + testlist = ['alpha', 'beta', 'theta']
> >> + self.assertListIsEqual('alpha beta theta', testlist)
> >> + self.assertListIsEqual('alpha beta\ttheta', testlist)
> >> + self.assertListIsEqual('alpha', ['alpha'])
> >> +
> >> + def test_list_usersep(self):
> >> + self.assertListIsEqual('foo:bar', ['foo', 'bar'], ':')
> >> + self.assertListIsEqual('foo:bar:baz', ['foo', 'bar', 'baz'],
> >> ':')
> >> diff --git a/meta/lib/oeqa/selftest/oe_tests/utils.py
> >> b/meta/lib/oeqa/selftest/oe_tests/utils.py
> >> new file mode 100644
> >> index 0000000..25c60e1
> >> --- /dev/null
> >> +++ b/meta/lib/oeqa/selftest/oe_tests/utils.py
> >> @@ -0,0 +1,52 @@
> >> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.decorators
> >> +import testcase from oe.utils import packages_filter_out_system,
> >> +trim_version
> >> +
> >> +class TestPackagesFilterOutSystem(oeSelfTest):
> >> + def test_filter(self):
> >> + """
> >> + Test that oe.utils.packages_filter_out_system works.
> >> + """
> >> + try:
> >> + import bb
> >> + except ImportError:
> >> + self.skipTest("Cannot import bb")
> >> +
> >> + d = bb.data_smart.DataSmart()
> >> + d.setVar("PN", "foo")
> >> +
> >> + d.setVar("PACKAGES", "foo foo-doc foo-dev")
> >> + pkgs = packages_filter_out_system(d)
> >> + self.assertEqual(pkgs, [])
> >> +
> >> + d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
> >> + pkgs = packages_filter_out_system(d)
> >> + self.assertEqual(pkgs, ["foo-data"])
> >> +
> >> + d.setVar("PACKAGES", "foo foo-locale-en-gb")
> >> + pkgs = packages_filter_out_system(d)
> >> + self.assertEqual(pkgs, [])
> >> +
> >> + d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
> >> + pkgs = packages_filter_out_system(d)
> >> + self.assertEqual(pkgs, ["foo-data"])
> >> +
> >> +
> >> +class TestTrimVersion(oeSelfTest):
> >> + def test_version_exception(self):
> >> + with self.assertRaises(TypeError):
> >> + trim_version(None, 2)
> >> + with self.assertRaises(TypeError):
> >> + trim_version((1, 2, 3), 2)
> >> +
> >> + def test_num_exception(self):
> >> + with self.assertRaises(ValueError):
> >> + trim_version("1.2.3", 0)
> >> + with self.assertRaises(ValueError):
> >> + trim_version("1.2.3", -1)
> >> +
> >> + def test_valid(self):
> >> + self.assertEqual(trim_version("1.2.3", 1), "1")
> >> + self.assertEqual(trim_version("1.2.3", 2), "1.2")
> >> + self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
> >> + self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
> >> --
> >> 2.1.4
> >>
^ permalink raw reply
* Re: [PATCH] rmc: Fix compiling issue with musl
From: Khem Raj @ 2016-11-14 23:15 UTC (permalink / raw)
To: Jianxun Zhang; +Cc: openembedded-core
In-Reply-To: <D48DD72C-50E1-4475-9976-65C59A0705D3@linux.intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 2369 bytes --]
On 11/14/16 3:08 PM, Jianxun Zhang wrote:
>
>> On Nov 14, 2016, at 2:50 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>
>>
>>
>> On 11/14/16 2:10 PM, Jianxun Zhang wrote:
>>> | src/rmcl/rmcl.c: In function 'query_policy_from_db':
>>> | src/rmcl/rmcl.c:254:25: error: unknown type name 'ssize_t'
>>> | ssize_t cmd_name_len = strlen((char *)&rmc_db[policy_idx]) + 1;
>>> | ^~~~~~~~
>>>
>>> The musl C lib provides ssize_t but we need to enable it
>>> with a macro.
>>>
>>> Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
>>> ---
>>> Before maintainer(s) push "merge" button, please read this short summary.
>>> I feel there could be a better syntax to do it. And We could need to get
>>> an ack from Hernandez, Alejandro who reported this issue and seems still
>>> have (other) compiling errors even with this patch.
>>>
>>> I submit this patch based on my thoughts and test out of tiny config.
>>>
>>> Tests:
>>> () Specify TCLIBC = "musl" in local.conf in my build dir.
>>> () Build quark
>>> () I can see this issue happens without the fix
>>> () With this patch and do clean builds for quark and corei7-64,
>>> Compiling passes. Boot test passed on RMC targets quark and Broxton-m.
>>>
>>> Thanks
>>>
>>>
>>> common/recipes-bsp/rmc/rmc.bb | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb
>>> index aeaf12e..61a1bdb 100644
>>> --- a/common/recipes-bsp/rmc/rmc.bb
>>> +++ b/common/recipes-bsp/rmc/rmc.bb
>>> @@ -24,6 +24,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*"
>>>
>>> EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"'
>>>
>>> +EXTRA_OEMAKE_append_libc-musl = '" -D__NEED_ssize_t"'
>>
>> this is not right way to handle it. you should be doing something like
>> #include <sys/types.h> in your source file
> Khem,
> Thanks lot for your review even when I wrongly submit it here! I tried it first but didn’t succeed for some reason with the suggested change.
mostly, it could be the makefiles not respecting the compiler options passed
from bitbake. You have to make sure that, all the -I<dir> options are used
properly which are relative to sysroot.
>
> Let me try it again...
>
>>
>>
>>> +
>>> # from gnu-efi, we should align arch-mapping with it.
>>> def rmc_efi_arch(d):
>>> import re
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
^ permalink raw reply
* Re: [PATCH] rmc: Fix compiling issue with musl
From: Jianxun Zhang @ 2016-11-14 23:08 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
In-Reply-To: <41ae9aed-3c93-09dc-bdde-5553fe5d5fbc@gmail.com>
> On Nov 14, 2016, at 2:50 PM, Khem Raj <raj.khem@gmail.com> wrote:
>
>
>
> On 11/14/16 2:10 PM, Jianxun Zhang wrote:
>> | src/rmcl/rmcl.c: In function 'query_policy_from_db':
>> | src/rmcl/rmcl.c:254:25: error: unknown type name 'ssize_t'
>> | ssize_t cmd_name_len = strlen((char *)&rmc_db[policy_idx]) + 1;
>> | ^~~~~~~~
>>
>> The musl C lib provides ssize_t but we need to enable it
>> with a macro.
>>
>> Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
>> ---
>> Before maintainer(s) push "merge" button, please read this short summary.
>> I feel there could be a better syntax to do it. And We could need to get
>> an ack from Hernandez, Alejandro who reported this issue and seems still
>> have (other) compiling errors even with this patch.
>>
>> I submit this patch based on my thoughts and test out of tiny config.
>>
>> Tests:
>> () Specify TCLIBC = "musl" in local.conf in my build dir.
>> () Build quark
>> () I can see this issue happens without the fix
>> () With this patch and do clean builds for quark and corei7-64,
>> Compiling passes. Boot test passed on RMC targets quark and Broxton-m.
>>
>> Thanks
>>
>>
>> common/recipes-bsp/rmc/rmc.bb | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/common/recipes-bsp/rmc/rmc.bb b/common/recipes-bsp/rmc/rmc.bb
>> index aeaf12e..61a1bdb 100644
>> --- a/common/recipes-bsp/rmc/rmc.bb
>> +++ b/common/recipes-bsp/rmc/rmc.bb
>> @@ -24,6 +24,8 @@ COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux*"
>>
>> EXTRA_OEMAKE='RMC_CFLAGS="-Wl,--hash-style=both"'
>>
>> +EXTRA_OEMAKE_append_libc-musl = '" -D__NEED_ssize_t"'
>
> this is not right way to handle it. you should be doing something like
> #include <sys/types.h> in your source file
Khem,
Thanks lot for your review even when I wrongly submit it here! I tried it first but didn’t succeed for some reason with the suggested change.
Let me try it again...
>
>
>> +
>> # from gnu-efi, we should align arch-mapping with it.
>> def rmc_efi_arch(d):
>> import re
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox