On Tue, Mar 17, 2015 at 03:46:35PM +0100, Nicolas Joly wrote:
> On Tue, Mar 17, 2015 at 02:32:16PM +0100, Cyril Hrubis wrote:
[...]
> > However this patch is incomplete because it removes only the
> > restoration part but leaves the then unused getrlimit() that gets
> > the original limit in setup, this should be removed (with the
> > global rlp_orig variable) as well.
>
> Right. Will submit a new patch.
Please find a new version that adress Cyril concerns.
Thanks.
--
Nicolas Joly
Biology IT Center
Institut Pasteur, Paris.
commit 17bd3f22655331b2aeef6a5fa56ef0480577482d
Author: Nicolas Joly <nj...@pasteur.fr>
Date: Wed Mar 18 08:40:59 2015 +0100
syscalls/llseek01: Fix unprivileged behaviour
Do not save and restore original file limits.
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..6c98a44 100644
--- a/testcases/kernel/syscalls/llseek/llseek01.c
+++ b/testcases/kernel/syscalls/llseek/llseek01.c
@@ -93,8 +93,6 @@ int TST_TOTAL = 1;
char write_buff[BUFSIZ]; /* buffer to hold data */
int fildes; /* file handle for temp file */
-struct rlimit rlp_orig; /* resource for original file size
limit */
-
void setup(); /* Main setup function of test */
void cleanup(); /* cleanup function for the test */
@@ -190,11 +188,6 @@ void setup(void)
tst_tmpdir();
- /* Store the original rlimit */
- if (getrlimit(RLIMIT_FSIZE, &rlp_orig) == -1)
- tst_brkm(TBROK, cleanup,
- "Cannot get max. file size using getrlimit");
-
/* Set limit low, argument is # bytes */
rlp.rlim_cur = rlp.rlim_max = 2 * BUFSIZ;
@@ -217,9 +210,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