[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-list
Subject:    [LTP] [PATCH] Change bufsize from -1 to 0 for "not positive buffer
From:       Daniel Gollub <dgollub () suse ! de>
Date:       2008-11-18 9:55:15
Message-ID: 200811181055.16217.dgollub () suse ! de
[Download RAW message or body]

Hi,

Change "Buffer size is not positive" testcase readlink03 to use 0 as
non-positive buffer size, instead of -1. To avoid a fortify-check-fail when
using glibc and _FORTIFY_SOURCE=2.

See discussion: http://lkml.org/lkml/2008/10/23/229

Signed-off-by: Daniel Gollub <dgollub@suse.de>

---
 testcases/kernel/syscalls/readlink/readlink03.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: ltp-full-20081031/testcases/kernel/syscalls/readlink/readlink03.c
===================================================================
--- ltp-full-20081031.orig/testcases/kernel/syscalls/readlink/readlink03.c
+++ ltp-full-20081031/testcases/kernel/syscalls/readlink/readlink03.c
@@ -119,8 +119,16 @@ struct test_case_t {		/* test case struc
 	int (*setupfunc)();
 } Test_cases[] = {
 	{ SYM_FILE1, "No Search permissions to process", EACCES, 1, setup1 },
+	/* Don't test with bufsize -1, since this cause a fortify-check-fail when
+	   using glibc and -D_FORITY_SOURCE=2
+           
+           Discussion: http://lkml.org/lkml/2008/10/23/229
+	   Conclusion: Only test with 0 as non-positive bufsize.
+
 	{ SYM_FILE2, "Buffer size is not positive", EINVAL, -1, setup2 },
-	{ TEST_FILE2, "File is not symbolic link", EINVAL, 1, no_setup },
+	*/
+	{ SYM_FILE2, "Buffer size is not positive", EINVAL, 0, setup2 },
+	{ TEST_FILE2, "File is not symbolic link", EINVAL, 1, no_setup }
 	{ Longpathname, "Symlink path too long", ENAMETOOLONG, 1, lpath_setup },
 	{ "", "Symlink Pathname is empty", ENOENT, 1, no_setup },
 	{ NULL, NULL, 0, 0, no_setup }


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic