summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-devtools/perl/files/fix-setgroup.patch
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-07-31 20:59:18 +0300
committerEd Tanous <ed.tanous@intel.com>2019-07-31 20:59:18 +0300
commitb4f66bacb1b8e661d794fa7a189e2f66f5092e2e (patch)
tree5a8302cd349fdb68dadca003483c61917d4a6add /poky/meta/recipes-devtools/perl/files/fix-setgroup.patch
parent43a183cc0926da36e3a218efa02ab4838ace316f (diff)
parentdd755025e33af27b059ea7ef3afbe850e4880b08 (diff)
downloadopenbmc-b4f66bacb1b8e661d794fa7a189e2f66f5092e2e.tar.xz
Merge branch 'master' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into intel
Diffstat (limited to 'poky/meta/recipes-devtools/perl/files/fix-setgroup.patch')
-rw-r--r--poky/meta/recipes-devtools/perl/files/fix-setgroup.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/perl/files/fix-setgroup.patch b/poky/meta/recipes-devtools/perl/files/fix-setgroup.patch
new file mode 100644
index 000000000..2b490e606
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/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 {