summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-07-14 16:05:44 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-16 21:23:44 +0100
commitb4f9b5b3facd2f62db100d59bb1ffe4bf029eaf9 (patch)
tree43da5fa40efc16fddfc0700b239a371ac8ddafea /meta/recipes-core/util-linux
parenteedab4b6c4e633b0db6a3aca983f4fd9e3fee94c (diff)
downloadpoky-b4f9b5b3facd2f62db100d59bb1ffe4bf029eaf9.tar.gz
util-linux: Fix signature of close_range()
close_range expects 3 parameters, thus far it was not implemented in glibc so it was hidden but with glibc 2.34+ it will start to show up (From OE-Core rev: 0d6f638230a96808e22438d9925aec6383d136a7) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux')
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc1
-rw-r--r--meta/recipes-core/util-linux/util-linux/0001-login-fix-close_range-use.patch62
2 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index f10d911fb1..0648366baf 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -41,6 +41,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin
41 file://tests-ul.patch \ 41 file://tests-ul.patch \
42 file://tests-eject.patch \ 42 file://tests-eject.patch \
43 file://tests-lscpu.patch \ 43 file://tests-lscpu.patch \
44 file://0001-login-fix-close_range-use.patch \
44 " 45 "
45 46
46SRC_URI[sha256sum] = "bd07b7e98839e0359842110525a3032fdb8eaf3a90bedde3dd1652d32d15cce5" 47SRC_URI[sha256sum] = "bd07b7e98839e0359842110525a3032fdb8eaf3a90bedde3dd1652d32d15cce5"
diff --git a/meta/recipes-core/util-linux/util-linux/0001-login-fix-close_range-use.patch b/meta/recipes-core/util-linux/util-linux/0001-login-fix-close_range-use.patch
new file mode 100644
index 0000000000..7a47597bd6
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/0001-login-fix-close_range-use.patch
@@ -0,0 +1,62 @@
1From 76ae0badd3fd7c8653fa4d3c78d2dcfcec51d23d Mon Sep 17 00:00:00 2001
2From: Karel Zak <kzak@redhat.com>
3Date: Wed, 14 Jul 2021 17:25:57 +0200
4Subject: [PATCH] login: fix close_range() use
5
6This new syscall comes with three arguments (see kernel commit
7278a5fbaed89dacd04e9d052f4594ffd0e0585de). Not sure why util-linux
8assume only two.
9
10Upstream-Status: Backport [https://github.com/karelzak/util-linux/commit/b8d99a618baffb4fc03cda4c40e29778b6d77ad4]
11Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1981729
12Signed-off-by: Karel Zak <kzak@redhat.com>
13---
14 include/fileutils.h | 4 ++--
15 lib/fileutils.c | 2 +-
16 login-utils/login.c | 2 +-
17 3 files changed, 4 insertions(+), 4 deletions(-)
18
19diff --git a/include/fileutils.h b/include/fileutils.h
20index ad54b95..f86426b 100644
21--- a/include/fileutils.h
22+++ b/include/fileutils.h
23@@ -82,9 +82,9 @@ static inline struct dirent *xreaddir(DIR *dp)
24 # if defined(SYS_close_range)
25 # include <sys/types.h>
26 # ifndef HAVE_CLOSE_RANGE
27-static inline int close_range(unsigned int first, unsigned int last)
28+static inline int close_range(unsigned int first, unsigned int last, int flags)
29 {
30- return syscall(SYS_close_range, first, last);
31+ return syscall(SYS_close_range, first, last, flags);
32 }
33 # endif
34 # define HAVE_CLOSE_RANGE 1
35diff --git a/lib/fileutils.c b/lib/fileutils.c
36index 846b718..a979b03 100644
37--- a/lib/fileutils.c
38+++ b/lib/fileutils.c
39@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
40 ignore_result( dup(STDIN_FILENO) );
41
42 # ifdef HAVE_CLOSE_RANGE
43- close_range(STDERR_FILENO + 1, ~0U);
44+ close_range(STDERR_FILENO + 1, ~0U, 0);
45 # else
46 ul_close_all_fds(STDERR_FILENO + 1, ~0U);
47 # endif
48diff --git a/login-utils/login.c b/login-utils/login.c
49index 7fefd05..94a042d 100644
50--- a/login-utils/login.c
51+++ b/login-utils/login.c
52@@ -1358,7 +1358,7 @@ static void initialize(int argc, char **argv, struct login_context *cxt)
53 #endif
54 }
55 #ifdef HAVE_CLOSE_RANGE
56- close_range(STDERR_FILENO + 1, ~0U);
57+ close_range(STDERR_FILENO + 1, ~0U, 0);
58 #else
59 ul_close_all_fds(STDERR_FILENO + 1, ~0U);
60 #endif
61--
622.32.0