xref: /aosp_15_r20/external/ltp/testcases/kernel/syscalls/mount/mount03_suid_child.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
4  * Copyright (c) 2022 Petr Vorel <[email protected]>
5  */
6 
7 /*
8  * SUID to root program invoked by a non-root process to validate the mount
9  * flag MS_NOSUID.
10  */
11 
12 #include <errno.h>
13 #include <unistd.h>
14 
15 #define TST_NO_DEFAULT_MAIN
16 #include "tst_test.h"
17 
main(void)18 int main(void)
19 {
20 	tst_reinit();
21 
22 	TST_EXP_FAIL(setreuid(getuid(), 0), EPERM);
23 
24 	return 0;
25 }
26