diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-14 08:44:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-15 13:46:38 +0100 |
commit | 5d8c4e3f47acd1b181760274a39d6707abd976b8 (patch) | |
tree | a47ed115d9af2dfe2cbed73c4a45166c88f562af /meta | |
parent | 68d6682398fd4c44aece04bf24dede1f645637e2 (diff) | |
download | poky-5d8c4e3f47acd1b181760274a39d6707abd976b8.tar.gz |
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]
(From OE-Core rev: c1c4907f0e548564e6744fef1cb93c74bd330c55)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/perl-sanity/files/fix-setgroup.patch | 49 | ||||
-rw-r--r-- | meta/recipes-devtools/perl-sanity/perl_5.30.0.bb | 1 |
2 files changed, 50 insertions, 0 deletions
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 0000000000..2b490e6067 --- /dev/null +++ b/meta/recipes-devtools/perl-sanity/files/fix-setgroup.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Test script to reproduce the problem: | ||
2 | |||
3 | #!/usr/bin/env perl | ||
4 | $) = "2 2"; | ||
5 | print $!; | ||
6 | |||
7 | Result from perl 5.28 under strace: | ||
8 | |||
9 | setgroups(1, [2]) = 0 | ||
10 | setresgid(-1, 2, -1) = 0 | ||
11 | |||
12 | Result from perl 5.30 under strace: | ||
13 | |||
14 | setgroups(1, [-1]) = -1 EINVAL (Invalid argument) | ||
15 | setresgid(-1, 2, -1) = 0 | ||
16 | |||
17 | Patch which broke this upstream: | ||
18 | https://perl5.git.perl.org/perl.git/commitdiff/5d4a52b5c68a11bfc97c2e24806993b84a61eade | ||
19 | |||
20 | Issue is that the new function changes the endptr to the end of the | ||
21 | scanned number and needs to be reset to the end of the string for | ||
22 | each iteration of the loop. | ||
23 | |||
24 | [YOCTO #13391] | ||
25 | |||
26 | RP | ||
27 | 2019/6/14 | ||
28 | Upstream-Status: Pending | ||
29 | |||
30 | Index: perl-5.30.0/mg.c | ||
31 | =================================================================== | ||
32 | --- perl-5.30.0.orig/mg.c | ||
33 | +++ perl-5.30.0/mg.c | ||
34 | @@ -3179,6 +3256,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) | ||
35 | const char *p = SvPV_const(sv, len); | ||
36 | Groups_t *gary = NULL; | ||
37 | const char* endptr = p + len; | ||
38 | + const char* realend = p + len; | ||
39 | UV uv; | ||
40 | #ifdef _SC_NGROUPS_MAX | ||
41 | int maxgrp = sysconf(_SC_NGROUPS_MAX); | ||
42 | @@ -3209,6 +3287,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) | ||
43 | Newx(gary, i + 1, Groups_t); | ||
44 | else | ||
45 | Renew(gary, i + 1, Groups_t); | ||
46 | + endptr = realend; | ||
47 | if (grok_atoUV(p, &uv, &endptr)) | ||
48 | gary[i] = (Groups_t)uv; | ||
49 | 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 90a8a035ce..b18a6b6913 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 \ | |||
18 | file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \ | 18 | file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \ |
19 | file://perl-dynloader.patch \ | 19 | file://perl-dynloader.patch \ |
20 | file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \ | 20 | file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \ |
21 | file://fix-setgroup.patch \ | ||
21 | " | 22 | " |
22 | SRC_URI_append_class-native = " \ | 23 | SRC_URI_append_class-native = " \ |
23 | file://perl-configpm-switch.patch \ | 24 | file://perl-configpm-switch.patch \ |