Skip to contentSkip to conversation

access(2): add ELOOP, ENOTDIR, EROFS error values test

PATCH Superseded Wang, Xiaoguang 2 participants 2 messages Oct 25, 2013 – Nov 4, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 access(2): add ELOOP, ENOTDIR, EROFS error values test

---
 runtest/ltplite                             |    2 +-
 runtest/stress.part3                        |    2 +-
 runtest/syscalls                            |    2 +-
 testcases/kernel/syscalls/access/access05.c |  123 ++++++++++++++++++++++++---
 4 files changed, 114 insertions(+), 15 deletions(-)
runtest/ltplite +1 -1
index 8ff55ee..f3aaea7 100644
@@ -65,7 +65,7 @@ access01 access01
 access02 access02
 access03 access03
 access04 access04
-access05 access05
+access05 access05 -D DEVICE -T DEVICE_FS_TYPE
 
 acct01 acct01
 acct02 acct02
runtest/stress.part3 +1 -1
index 0533d4d..9a97743 100644
@@ -7,7 +7,7 @@ access01 access01
 access02 access02
 access03 access03
 access04 access04
-access05 access05
+access05 access05 -D DEVICE -T DEVICE_FS_TYPE
 
 acct01 acct01
 acct02 acct02
runtest/syscalls +1 -1
index 09e5f7f..c6056f5 100644
@@ -8,7 +8,7 @@ access01 access01
 access02 access02
 access03 access03
 access04 access04
-access05 access05
+access05 access05 -D DEVICE -T DEVICE_FS_TYPE
 
 acct01 acct01
 acct02 acct02
testcases/kernel/syscalls/access/access05.c +111 -12

201 lines not on this page · raw message

Signature · 13 lines
1.7.1


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 7 lines

+/*
+ * EROFS need superuser privilege (mount and umount a readonly file system),
+ * but the other error values tests need a normal user.
+ * So we first call setup1() with superuser privilege to test EROFS, and then
+ * use setup() to call setuid()to change the real user id to perform
+ * other tests.
+ */

Ah, this adds unexpected complexity and does not work test looping :(.

I've looked closely on the test code and the problem is that acces uses real user id so we have to drop the rights to check the access call but we need to be able to unmount the fs at the end of the test, which is privileged operation.

Only solution that I have currenlty in mind is to run the test from within the child process that drops the rights so that the parent can perform the cleanup at the end, but again this adds unnecessary complexity.

Was this problem the original reason why you added the new testcase for the EROFS part? If so, you should have spoken as I did not foresee that we will hit this problem.

So we should either proceed with the previous version (EROFS in separate test) or move the code to child processes. The first solution seems better to me, what do you think?

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list