I propose this new test setuid04 for the setuid syscall. The goal if this test is to check the fsuid is correctly handled by the setuid syscall. To do so, the test create a testfile as root with permission 0644, then do a setuid and try to open the file RDWR. This last open must fail since the process with new UID is not allowed to open the file on write. In a second step, the test does a fork to check the fsuid is correctly passed to a son and the son behaves correctly regarding files, i.e. it cannot open on write the test file.
I propose this new test setfsuid04 for the setfsuid syscall. The goal if this test is to check the fsuid is correctly handled by the setfsuid syscall. To do so, the test creates a testfile as root with permission 0644, then do a setuid and try to open the file RDWR. This last open must fail since the process with new UID is not allowed to open the file on write. In a second step, the test does a fork to check the fsuid is correctly passed to a son and the son behaves correctly regarding files, i.e. it cannot open on write the test file. Finally, the test falls back to the initial UID and try to open the file on write. This open must succeed.
I propose this new test setreuid07 for the setreuid syscall. The goal if this test is to check the fsuid is correctly handled by the setreuid syscall. To do so, the test creates a testfile as root with permission 0644, then do a setreuid and try to open the file RDWR. This last open must fail since the process with new UID is not allowed to open the file on write. In a second step, the test does a fork to check the fsuid is correctly passed to a son and the son behaves correctly regarding files, i.e. it cannot open on write the test file. Finally, the test falls back to the initial UID and try to open the file on write. This open must succeed.
I also propose this new test setresuid04 for the setresuid syscall. The goal if this test is to check the fsuid is correctly handled by the setresuid syscall. To do so, the test creates a testfile as root with permission 0644, then do a setresuid and try to open the file RDWR. This last open must fail since the process with new UID is not allowed to open the file on write. In a second step, the test does a fork to check the fsuid is correctly passed to a son and the son behaves correctly regarding files, i.e. it cannot open on write the test file. Finally, the test falls back to the initial UID and try to open the file on write. This open must succeed.
Signed-Off-By: Renaud Lottiaux <Renaud.Lottiaux@kerlabs.com>,
Signed-Off-By: Subrata Modak <subrata@linux.vnet.ibm.com>.
7 files changed