diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo')
11 files changed, 244 insertions, 45 deletions
diff --git a/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch b/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch new file mode 100644 index 0000000000..43504eaab9 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch @@ -0,0 +1,44 @@ +From b5545c08e6c674c49aef14b47a56a3e92df4d2a7 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 17 Feb 2016 07:36:34 +0000 +Subject: [pseudo][PATCH] configure: Prune PIE flags + +LDFLAGS are not taken from environment and CFLAGS is used for LDFLAGS +however when using security options -fpie and -pie options are coming +as part of ARCH_FLAGS and they get into LDFLAGS of shared objects as +well so we end up with conflicting options -shared -pie, which gold +rejects outright and bfd linker lets the one appearning last in cmdline +take effect. This create quite a unpleasant situation in OE when +security flags are enabled and gold or not-gold options are used +it errors out but errors are not same. + +Anyway, with this patch we filter pie options from ARCH_FLAGS +ouright and take control of generating PIC objects + +Helps with errors like + +| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: pseudo_client.o: relocation R_X86_64_PC32 against symbol `pseudo_util_debug_flags' can not be used when making a shared object; recompile with -fPIC +| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value +| collect2: error: ld returned 1 exit status +| make: *** [lib/pseudo/lib64/libpseudo.so] Error 1 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Submitted + + configure | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure b/configure +index e5ef9ce..83b0890 100755 +--- a/configure ++++ b/configure +@@ -339,3 +339,5 @@ sed -e ' + s,@ARCH@,'"$opt_arch"',g + s,@BITS@,'"$opt_bits"',g + ' < Makefile.in > Makefile ++ ++sed -i -e 's/\-[f]*pie//g' Makefile +-- +1.8.3.1 + diff --git a/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch b/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch new file mode 100644 index 0000000000..3045a3b736 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch @@ -0,0 +1,48 @@ +From b6b68db896f9963558334aff7fca61adde4ec10f Mon Sep 17 00:00:00 2001 +From: Seebs <seebs@seebs.net> +Date: Thu, 13 Apr 2017 18:12:01 -0500 +Subject: Prevent bash from segfaulting when unloading pseudo + +bash's extremely fancy internal awareness of how the environment looks +means that, if you directly call the underlying libc "unsetenv" on +a variable, bash can end up trying to access a null pointer. Fixing +this generically is actually rather hard; you can't really avoid +writing to environ on fork() or popen(), even if you change all +execv*() functions to use the execv*e() variants. So for now, instead +of unsetting the variable, set it to an empty string. + +Thanks to Saur in IRC for spotting this and helping debug it. + +Signed-off-by: Seebs <seebs@seebs.net> + +Upstream-Status: Backport + +diff --git a/ChangeLog.txt b/ChangeLog.txt +index a2d30e9..8ba1ffa 100644 +--- a/ChangeLog.txt ++++ b/ChangeLog.txt +@@ -1,3 +1,8 @@ ++2017-04-13: ++ * (seebs) don't unset LD_PRELOAD or the like, because if you ++ do that, bash can segfault because it "knows" how many ++ fields are in environ. ++ + 2017-02-24: + * (seebs) import posix_acl_default fix from Anton Gerasimov + <anton@advancedtelematic.com> +diff --git a/pseudo_util.c b/pseudo_util.c +index 172990b..6a1fac2 100644 +--- a/pseudo_util.c ++++ b/pseudo_util.c +@@ -844,7 +844,7 @@ void pseudo_dropenv() { + if (ld_preload && strlen(ld_preload)) { + SETENV(PRELINK_LIBRARIES, ld_preload, 1); + } else { +- UNSETENV(PRELINK_LIBRARIES); ++ SETENV(PRELINK_LIBRARIES, "", 1); + } + } + } +-- +cgit v0.10.2 + diff --git a/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch b/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch new file mode 100644 index 0000000000..64fc58c4fe --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch @@ -0,0 +1,99 @@ +From efe0be279901006f939cd357ccee47b651c786da Mon Sep 17 00:00:00 2001 +From: Seebs <seebs@seebs.net> +Date: Fri, 24 Feb 2017 12:47:38 -0600 +Subject: Don't try to record 0-length posix_acl_default xattrs + +Based on a submission from Anton Gerasimov <anton@advancedtelematic.com> + +On some systems, with some kernel configs, "cp -a" apparently tries to +set an empty ACL list, with a valid header but no contents, which causes +strange and mysterious behavior later if we actually create such an entry. +So filter that out, also sanity-check a couple of other things. + +Signed-off-by: Seebs <seebs@seebs.net> + +Upstream-Status: Backport + +diff --git a/ChangeLog.txt b/ChangeLog.txt +index ae2a6e9..a2d30e9 100644 +--- a/ChangeLog.txt ++++ b/ChangeLog.txt +@@ -1,3 +1,6 @@ ++2017-02-24: ++ * (seebs) import posix_acl_default fix from Anton Gerasimov ++ <anton@advancedtelematic.com> + 2017-02-01: + * (seebs) handle xattr deletion slightly more carefully. + * (seebs) tag this as 1.8.2 +diff --git a/ports/linux/xattr/pseudo_wrappers.c b/ports/linux/xattr/pseudo_wrappers.c +index 46bc053..d69d53e 100644 +--- a/ports/linux/xattr/pseudo_wrappers.c ++++ b/ports/linux/xattr/pseudo_wrappers.c +@@ -62,9 +62,9 @@ static int + posix_permissions(const acl_header *header, int entries, int *extra, int *mode) { + int acl_seen = 0; + if (le32(header->version) != 2) { +- pseudo_diag("Fatal: ACL support no available for header version %d.\n", ++ pseudo_diag("Fatal: ACL support not available for header version %d.\n", + le32(header->version)); +- return 1; ++ return -1; + } + *mode = 0; + *extra = 0; +@@ -140,12 +140,38 @@ static int shared_setxattr(const char *path, int fd, const char *name, const voi + pseudo_debug(PDBGF_XATTR, "setxattr(%s [fd %d], %s => '%.*s')\n", + path ? path : "<no path>", fd, name, (int) size, (char *) value); + ++ /* Filter out erroneous sizes for POSIX ACL ++ * see posix_acl_xattr_count in include/linux/posix_acl_xattr.h of Linux source code */ ++ /* I don't think there's any posix_acl_* values that aren't in this format */ ++ if (!strncmp(name, "system.posix_acl_", 17)) { ++ // ACL is corrupt, issue an error ++ if(size < sizeof(acl_header) || (size - sizeof(acl_header)) % sizeof(acl_entry) != 0) { ++ pseudo_debug(PDBGF_XATTR, "invalid data size for %s: %d\n", ++ name, (int) size); ++ errno = EINVAL; ++ return -1; ++ } ++ ++ // ACL is empty, do nothing ++ if((size - sizeof(acl_header)) / sizeof(acl_entry) == 0) { ++ /* on some systems, "cp -a" will attempt to clone the ++ * posix_acl_default entry for a directory (which would specify ++ * default ACLs for new files in that directory), but if the ++ * original was empty, we get a header but no entries. With ++ * real xattr, that ends up being silently discarded, apparently, ++ * so we discard it too. ++ */ ++ pseudo_debug(PDBGF_XATTR, "0-length ACL entry %s.\n", name); ++ return 0; ++ } ++ } + /* this may be a plain chmod */ + if (!strcmp(name, "system.posix_acl_access")) { + int extra; + int mode; + int entries = (size - sizeof(acl_header)) / sizeof(acl_entry); +- if (!posix_permissions(value, entries, &extra, &mode)) { ++ int res = posix_permissions(value, entries, &extra, &mode); ++ if (res == 0) { + pseudo_debug(PDBGF_XATTR, "posix_acl_access translated to mode %04o. Remaining attribute(s): %d.\n", + mode, extra); + buf.st_mode = mode; +@@ -164,8 +190,12 @@ static int shared_setxattr(const char *path, int fd, const char *name, const voi + if (!extra) { + return 0; + } ++ } else if (res == -1) { ++ errno = EOPNOTSUPP; ++ return -1; + } + } ++ + if (!strcmp(name, "user.pseudo_data")) { + pseudo_debug(PDBGF_XATTR | PDBGF_XATTRDB, "user.pseudo_data xattribute does not get to go in database.\n"); + return -1; +-- +cgit v0.10.2 + diff --git a/meta/recipes-devtools/pseudo/files/fallback-group b/meta/recipes-devtools/pseudo/files/fallback-group index 81bf732312..bb3dbca606 100644 --- a/meta/recipes-devtools/pseudo/files/fallback-group +++ b/meta/recipes-devtools/pseudo/files/fallback-group @@ -1,2 +1,3 @@ root:*:0: mail:*:8: +nobody:*:99: diff --git a/meta/recipes-devtools/pseudo/files/fallback-passwd b/meta/recipes-devtools/pseudo/files/fallback-passwd index c1458dc0f6..08611baaf4 100644 --- a/meta/recipes-devtools/pseudo/files/fallback-passwd +++ b/meta/recipes-devtools/pseudo/files/fallback-passwd @@ -1 +1,3 @@ root::0:0:root:/home/root:/bin/sh +pseudopasswd:*:1:1:this-is-the-pseudo-passwd:/nonexistent:/bin/sh +nobody:*:65534:65534:nobody:/nonexistent:/bin/sh diff --git a/meta/recipes-devtools/pseudo/files/moreretries.patch b/meta/recipes-devtools/pseudo/files/moreretries.patch new file mode 100644 index 0000000000..adea2665b0 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/moreretries.patch @@ -0,0 +1,19 @@ +Increase the number of retries in pseudo due to occasional slow +server shutdowns. + +Upstream-Status: Pending +RP 2016/2/28 + +Index: git/pseudo_client.c +=================================================================== +--- git.orig/pseudo_client.c ++++ git/pseudo_client.c +@@ -1282,7 +1282,7 @@ pseudo_client_setup(void) { + } + } + +-#define PSEUDO_RETRIES 20 ++#define PSEUDO_RETRIES 250 + static pseudo_msg_t * + pseudo_client_request(pseudo_msg_t *msg, size_t len, const char *path) { + pseudo_msg_t *response = 0; diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc index fe12258fd4..18ce9f9259 100644 --- a/meta/recipes-devtools/pseudo/pseudo.inc +++ b/meta/recipes-devtools/pseudo/pseudo.inc @@ -10,7 +10,6 @@ LICENSE = "LGPL2.1" DEPENDS = "sqlite3 attr" FILES_${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* ${localstatedir}/pseudo ${prefix}/var/pseudo" -FILES_${PN}-dbg += "${prefix}/lib/pseudo/lib*/.debug" INSANE_SKIP_${PN} += "libdir" INSANE_SKIP_${PN}-dbg += "libdir" @@ -27,6 +26,8 @@ do_configure () { NO32LIBS ??= "1" NO32LIBS_class-nativesdk = "1" +PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback" + # Compile for the local machine arch... do_compile () { if [ "${SITEINFO_BITS}" = "64" ]; then @@ -113,10 +114,15 @@ do_install () { oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install } -# Two below are the same -# If necessary install for the alternative machine arch. This is only -# necessary in a native build. do_install_append_class-native () { + install -d ${D}${sysconfdir} + # The fallback files should never be modified + install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd + install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group + + # Two native/nativesdk entries below are the same + # If necessary install for the alternative machine arch. This is only + # necessary in a native build. maybe_make32 if $make32; then mkdir -p ${D}${prefix}/lib/pseudo/lib @@ -130,6 +136,7 @@ do_install_append_class-nativesdk () { mkdir -p ${D}${prefix}/lib/pseudo/lib cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/. fi + chrpath -d ${D}${prefix}/lib/pseudo/lib*/libpseudo.so } BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb b/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb deleted file mode 100644 index b8c20ad65a..0000000000 --- a/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb +++ /dev/null @@ -1,19 +0,0 @@ -require pseudo.inc - -SRC_URI = " \ - http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ - file://fallback-passwd \ - file://fallback-group \ -" - -SRC_URI[md5sum] = "4cd39502f9bd0e734dee80e08b28a5f1" -SRC_URI[sha256sum] = "9f2caca5f1579a376a509cd81a81156fc208650add9f0af275da9e911f18f291" - -PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback" - -do_install_append_class-native () { - install -d ${D}${sysconfdir} - # The fallback files should never be modified - install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd - install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group -} diff --git a/meta/recipes-devtools/pseudo/pseudo_1.7.4.bb b/meta/recipes-devtools/pseudo/pseudo_1.7.4.bb deleted file mode 100644 index d68e0af7d5..0000000000 --- a/meta/recipes-devtools/pseudo/pseudo_1.7.4.bb +++ /dev/null @@ -1,19 +0,0 @@ -require pseudo.inc - -SRC_URI = " \ - http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ - file://fallback-passwd \ - file://fallback-group \ -" - -SRC_URI[md5sum] = "6e4b59a346d08d4a29133c335ea12052" -SRC_URI[sha256sum] = "f33ff84da328f943155f22cfd49030ef4ad85ad35fc2d9419a203521b65c384c" - -PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback" - -do_install_append_class-native () { - install -d ${D}${sysconfdir} - # The fallback files should never be modified - install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd - install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group -} diff --git a/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb b/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb new file mode 100644 index 0000000000..b427b9ac3c --- /dev/null +++ b/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb @@ -0,0 +1,13 @@ +require pseudo.inc + +SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ + file://0001-configure-Prune-PIE-flags.patch \ + file://fallback-passwd \ + file://fallback-group \ + file://moreretries.patch \ + file://efe0be279901006f939cd357ccee47b651c786da.patch \ + file://b6b68db896f9963558334aff7fca61adde4ec10f.patch \ + " + +SRC_URI[md5sum] = "7d41e72188fbea1f696c399c1a435675" +SRC_URI[sha256sum] = "ceb456bd47770a37ca20784a91d715c5a7601e07e26ab11b0c77e9203ed3d196" diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb index eb666c064d..42c7b2ea57 100644 --- a/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb @@ -1,11 +1,15 @@ require pseudo.inc -SRCREV = "3bc3909fa70535c2ef876009dc58e577b10a7e0e" -PV = "1.7.4+git${SRCPV}" +SRCREV = "02168305b0a19f981ffe857f36eb256ba8810b77" +PV = "1.8.2+git${SRCPV}" DEFAULT_PREFERENCE = "-1" -SRC_URI = "git://git.yoctoproject.org/pseudo" +SRC_URI = "git://git.yoctoproject.org/pseudo \ + file://0001-configure-Prune-PIE-flags.patch \ + file://fallback-passwd \ + file://fallback-group \ + file://moreretries.patch" S = "${WORKDIR}/git" |
