xref: /aosp_15_r20/external/ltp/testcases/kernel/security/smack/smack_notroot.c (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1 /*
2  * Copyright (C) 2007 Casey Schaufler <[email protected]>
3  *
4  *	This program is free software; you can redistribute it and/or modify
5  *	it under the terms of the GNU General Public License as published by
6  *	the Free Software Foundation, version 2.
7  *
8  * Author:
9  *	Casey Schaufler <[email protected]>
10  */
11 
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include <unistd.h>
16 
17 #include <sys/types.h>
18 #include <sys/stat.h>
19 #include <fcntl.h>
20 
main(int argc,char * argv[])21 int main(int argc, char *argv[])
22 {
23 	setuid(1);
24 
25 	execv(argv[1], &argv[1]);
26 
27 	perror(argv[0]);
28 	exit(1);
29 }
30