mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 17:19:20 +00:00
ltp: use upstream patch to fix faccessat/fchmodat build warnings
Use 0037-faccessat-and-fchmodat-Fx-build-warnings.patch instead of 0012-fix-faccessat01.c-build-fails-with-security-flags.patch. The new patch has been merged upstream and will be available in next LTP release. (From OE-Core rev: 3c1d9629ac3b5af47d0f4db09b4eb7e0eb4b0afe) Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
f6eb3edee3
commit
9db6fe1d5d
-70
@@ -1,70 +0,0 @@
|
||||
From 32f563008f95975d26d1c4fcb266c72c56f934be Mon Sep 17 00:00:00 2001
|
||||
From: Dengke Du <dengke.du@windriver.com>
|
||||
Date: Wed, 22 Feb 2017 01:21:55 -0500
|
||||
Subject: [PATCH] fix faccessat01.c build fails with security flags
|
||||
|
||||
When the distro is poky-lsb, fix the following error:
|
||||
|
||||
| In file included from ../../../../include/old/test.h:47:0,
|
||||
| from faccessat01.c:44:
|
||||
| faccessat01.c: In function 'setup':
|
||||
| ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security]
|
||||
| (path), (fmt), ## __VA_ARGS__)
|
||||
| ^
|
||||
| faccessat01.c:132:2: note: in expansion of macro 'SAFE_FILE_PRINTF'
|
||||
| SAFE_FILE_PRINTF(cleanup, testfile, testfile);
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
| ../../../../include/old/old_safe_file_ops.h:55:27: error: format not a string literal and no format arguments [-Werror=format-security]
|
||||
| (path), (fmt), ## __VA_ARGS__)
|
||||
| ^
|
||||
| faccessat01.c:133:2: note: in expansion of macro 'SAFE_FILE_PRINTF'
|
||||
| SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
|
||||
This is because in macro "SAFE_FILE_PRINTF", its third argument should be a
|
||||
format arguments, but in file faccessat01.c, it passed the same argument to
|
||||
macro "SAFE_FILE_PRINTF", so it results in the fails. It should pass the format
|
||||
string to the third argument.
|
||||
|
||||
The same for file fchmodat01.c.
|
||||
|
||||
Signed-off-by: Dengke Du <dengke.du@windriver.com>
|
||||
Upstream-Status: Pending
|
||||
---
|
||||
testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++--
|
||||
testcases/kernel/syscalls/fchmodat/fchmodat01.c | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
|
||||
index 622dfd3..1ca90e9 100644
|
||||
--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
|
||||
+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
|
||||
@@ -129,8 +129,8 @@ void setup(void)
|
||||
fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
|
||||
fds[1] = fds[4] = fds[0];
|
||||
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile, "faccessattestfile%d.txt");
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s/faccessattestfile%d.txt");
|
||||
|
||||
fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
|
||||
|
||||
diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
|
||||
index 6bf66d8..89d072a 100644
|
||||
--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
|
||||
+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
|
||||
@@ -127,8 +127,8 @@ void setup(void)
|
||||
fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
|
||||
fds[1] = fds[4] = fds[0];
|
||||
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile, "fchmodattest%d.txt");
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s/fchmodattest%d.txt");
|
||||
|
||||
fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
|
||||
fds[3] = 100;
|
||||
--
|
||||
2.8.1
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
From 4141bdb441f7576a2e73abeb2a0fb1c7b8bd8647 Mon Sep 17 00:00:00 2001
|
||||
From: Naresh Kamboju <naresh.kamboju@linaro.org>
|
||||
Date: Mon, 19 Jun 2017 19:01:21 +0530
|
||||
Subject: [PATCH 1/7] faccessat and fchmodat: Fix build warnings
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Fixing below build warnings.
|
||||
|
||||
ltp-full-20170516/testcases/kernel/syscalls/faccessat$ make
|
||||
In file included from ../../../../include/old/test.h:51:0,
|
||||
from faccessat01.c:44:
|
||||
faccessat01.c: In function ‘setup’:
|
||||
../../../../include/old/old_safe_file_ops.h:55:27:
|
||||
warning: format not a string literal and no format arguments [-Wformat-security]
|
||||
(path), (fmt), ## __VA_ARGS__)
|
||||
^
|
||||
faccessat01.c:132:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’
|
||||
SAFE_FILE_PRINTF(cleanup, testfile, testfile);
|
||||
^
|
||||
../../../../include/old/old_safe_file_ops.h:55:27:
|
||||
warning: format not a string literal and no format arguments [-Wformat-security]
|
||||
(path), (fmt), ## __VA_ARGS__)
|
||||
^
|
||||
faccessat01.c:133:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’
|
||||
SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
|
||||
|
||||
Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
|
||||
Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/4141bdb441f7576a2e73abeb2a0fb1c7b8bd8647]
|
||||
---
|
||||
testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++--
|
||||
testcases/kernel/syscalls/fchmodat/fchmodat01.c | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
|
||||
index 622dfd3b0..def7fa755 100644
|
||||
--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
|
||||
+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
|
||||
@@ -129,8 +129,8 @@ void setup(void)
|
||||
fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
|
||||
fds[1] = fds[4] = fds[0];
|
||||
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile);
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2);
|
||||
|
||||
fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
|
||||
|
||||
diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
|
||||
index 6bf66d8b8..7856ed3fa 100644
|
||||
--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
|
||||
+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
|
||||
@@ -127,8 +127,8 @@ void setup(void)
|
||||
fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
|
||||
fds[1] = fds[4] = fds[0];
|
||||
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile, testfile);
|
||||
- SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile);
|
||||
+ SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2);
|
||||
|
||||
fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
|
||||
fds[3] = 100;
|
||||
--
|
||||
2.13.0
|
||||
|
||||
@@ -35,7 +35,6 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
|
||||
file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \
|
||||
file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
|
||||
file://0011-Rename-sigset-variable-to-sigset1.patch \
|
||||
file://0012-fix-faccessat01.c-build-fails-with-security-flags.patch \
|
||||
file://0018-guard-mallocopt-with-__GLIBC__.patch \
|
||||
file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
|
||||
file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
|
||||
@@ -51,6 +50,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
|
||||
file://0035-fix-test_proc_kill-hang.patch \
|
||||
file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
|
||||
file://0001-dirtyc0w-Include-stdint.h.patch \
|
||||
file://0037-faccessat-and-fchmodat-Fix-build-warnings.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
Reference in New Issue
Block a user