[oe-commits] [openembedded-core] 01/01: perl: Fix setgroup call regression from 5.30

git at git.openembedded.org git at git.openembedded.org
Fri Jun 14 21:49:17 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit c1c4907f0e548564e6744fef1cb93c74bd330c55
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Jun 14 08:44:15 2019 +0100

    perl: Fix setgroup call regression from 5.30
    
    The upgrade from 5.28 to 5.30 caused acl's ptests to fail. The issue is
    that the new function changes the endptr to the end of the scanned number
    and this now needs to be reset to the end of the string for each iteration
    of the loop.
    
    [YOCTO #13391]
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 .../perl-sanity/files/fix-setgroup.patch           | 49 ++++++++++++++++++++++
 meta/recipes-devtools/perl-sanity/perl_5.30.0.bb   |  1 +
 2 files changed, 50 insertions(+)

diff --git a/meta/recipes-devtools/perl-sanity/files/fix-setgroup.patch b/meta/recipes-devtools/perl-sanity/files/fix-setgroup.patch
new file mode 100644
index 0000000..2b490e6
--- /dev/null
+++ b/meta/recipes-devtools/perl-sanity/files/fix-setgroup.patch
@@ -0,0 +1,49 @@
+Test script to reproduce the problem:
+
+#!/usr/bin/env perl
+$) = "2 2";
+print $!;
+
+Result from perl 5.28 under strace:
+
+setgroups(1, [2])                       = 0
+setresgid(-1, 2, -1)                    = 0
+
+Result from perl 5.30 under strace:
+
+setgroups(1, [-1])                      = -1 EINVAL (Invalid argument)
+setresgid(-1, 2, -1)                    = 0
+
+Patch which broke this upstream:
+https://perl5.git.perl.org/perl.git/commitdiff/5d4a52b5c68a11bfc97c2e24806993b84a61eade
+
+Issue is that the new function changes the endptr to the end of the
+scanned number and needs to be reset to the end of the string for 
+each iteration of the loop.
+
+[YOCTO #13391]
+
+RP
+2019/6/14
+Upstream-Status: Pending
+
+Index: perl-5.30.0/mg.c
+===================================================================
+--- perl-5.30.0.orig/mg.c
++++ perl-5.30.0/mg.c
+@@ -3179,6 +3256,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
+ 	    const char *p = SvPV_const(sv, len);
+             Groups_t *gary = NULL;
+             const char* endptr = p + len;
++            const char* realend = p + len;
+             UV uv;
+ #ifdef _SC_NGROUPS_MAX
+            int maxgrp = sysconf(_SC_NGROUPS_MAX);
+@@ -3209,6 +3287,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
+                     Newx(gary, i + 1, Groups_t);
+                 else
+                     Renew(gary, i + 1, Groups_t);
++                endptr = realend;
+                 if (grok_atoUV(p, &uv, &endptr))
+                     gary[i] = (Groups_t)uv;
+                 else {
diff --git a/meta/recipes-devtools/perl-sanity/perl_5.30.0.bb b/meta/recipes-devtools/perl-sanity/perl_5.30.0.bb
index 90a8a03..b18a6b6 100644
--- a/meta/recipes-devtools/perl-sanity/perl_5.30.0.bb
+++ b/meta/recipes-devtools/perl-sanity/perl_5.30.0.bb
@@ -18,6 +18,7 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
            file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \
            file://perl-dynloader.patch \
            file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \
+           file://fix-setgroup.patch \
            "
 SRC_URI_append_class-native = " \
            file://perl-configpm-switch.patch \

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list