Hi,

Running llseek01 testcase as unprivileged user currently fails.

njoly@raya [syscalls/llseek]> ./llseek01
llseek01    1  TPASS  :  Functionality of llseek() on tmp_file successful
llseek01    2  TBROK  :  llseek01.c:223: Cannot reset max. file size using 
setrlimit
llseek01    3  TBROK  :  llseek01.c:223: Remaining cases broken

This issue comes from cleanup function that tries to restore
previously altered file size limit. But this fails as unprivileged
because it cannot raise the hard limits.

The attached patch make the testcase succeed as unprivileged by
removing the offending setrlimit call.

njoly@raya [syscalls/llseek]> ./llseek01
llseek01    1  TPASS  :  Functionality of llseek() on tmp_file successful

Hope this helps,
Regards.

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.
commit a98d20f5a35ecb09c0185ef7b8be1e46d726c1c9
Author: Nicolas Joly <nj...@pasteur.fr>
Date:   Tue Mar 17 07:51:21 2015 +0100

    syscalls/llseek01: Fix unprivileged behaviour
    
    Kill unneeded setrlimit call from cleanup.
    Only privileged process can increase hard limits.
    
    Signed-off-by: Nicolas Joly <nj...@pasteur.fr>

diff --git a/testcases/kernel/syscalls/llseek/llseek01.c 
b/testcases/kernel/syscalls/llseek/llseek01.c
index b956dbf..5202d3b 100644
--- a/testcases/kernel/syscalls/llseek/llseek01.c
+++ b/testcases/kernel/syscalls/llseek/llseek01.c
@@ -217,9 +217,4 @@ void cleanup(void)
        SAFE_CLOSE(NULL, fildes);
 
        tst_rmdir();
-
-       if (setrlimit(RLIMIT_FSIZE, &rlp_orig) == -1)
-               tst_brkm(TBROK, NULL,
-                        "Cannot reset max. file size using setrlimit");
-
 }
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to