All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [COMMITTED] [PATCH 1/2] fcntl36: Do not pass char* pointer to tst_res() fmt
@ 2018-01-17 14:56 Cyril Hrubis
  2018-01-17 14:56 ` [LTP] [COMMITTED] [PATCH 2/2] endian_switch01: Fix build on older distros Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Cyril Hrubis @ 2018-01-17 14:56 UTC (permalink / raw)
  To: ltp

The format string has to be constant, passing pointers directly is a bad
practice that may result in security exploit and some build systems even
do not produce packages if such warning is found in the compiler logs.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/fcntl/fcntl36.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/fcntl/fcntl36.c b/testcases/kernel/syscalls/fcntl/fcntl36.c
index 6f2eb6b34..3246d1389 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl36.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl36.c
@@ -300,7 +300,7 @@ static void test_fn(void *f0(void *), void *f1(void *),
 	struct param p2[thread_cnt];
 	unsigned char buf[write_size];
 
-	tst_res(TINFO, msg);
+	tst_res(TINFO, "%s", msg);
 
 	if (tst_fill_file(fname, 1, write_size, thread_cnt + 1))
 		tst_brk(TBROK, "Failed to create tst file");
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [LTP] [COMMITTED] [PATCH 2/2] endian_switch01: Fix build on older distros.
  2018-01-17 14:56 [LTP] [COMMITTED] [PATCH 1/2] fcntl36: Do not pass char* pointer to tst_res() fmt Cyril Hrubis
@ 2018-01-17 14:56 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2018-01-17 14:56 UTC (permalink / raw)
  To: ltp

Fixes build failures:

...
In function `test_le_switch':
endian_switch01.c:84: undefined reference to `WIFSIGNALED'
endian_switch01.c:88: undefined reference to `WIFEXITED'
endian_switch01.c:85: undefined reference to `WTERMSIG'
endian_switch01.c:89: undefined reference to `WEXITSTATUS'
...
collect2: ld returned 1 exit status

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/switch/endian_switch01.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/kernel/syscalls/switch/endian_switch01.c b/testcases/kernel/syscalls/switch/endian_switch01.c
index 3e5ff47fc..777280afb 100644
--- a/testcases/kernel/syscalls/switch/endian_switch01.c
+++ b/testcases/kernel/syscalls/switch/endian_switch01.c
@@ -27,6 +27,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <elf.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 #include "tst_test.h"
 
 #if defined (__powerpc64__) || (__powerpc__)
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-17 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 14:56 [LTP] [COMMITTED] [PATCH 1/2] fcntl36: Do not pass char* pointer to tst_res() fmt Cyril Hrubis
2018-01-17 14:56 ` [LTP] [COMMITTED] [PATCH 2/2] endian_switch01: Fix build on older distros Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.