xref: /minix3/minix/tests/t60a.c (revision 99e8768deb6d3e9e4798167e690ca36ceaf0373b)
1433d6423SLionel Sambuc #include <unistd.h>
2433d6423SLionel Sambuc #include <stdlib.h>
3433d6423SLionel Sambuc #include <stdio.h>
4433d6423SLionel Sambuc 
main(int argc,char * argv[])5433d6423SLionel Sambuc int main(int argc, char *argv[])
6433d6423SLionel Sambuc {
7433d6423SLionel Sambuc /* Return our tainted state to the parent */
8433d6423SLionel Sambuc   int newmode;
9433d6423SLionel Sambuc   char cmd[30];
10433d6423SLionel Sambuc 
11433d6423SLionel Sambuc   if (argc < 2) return(-2);
12433d6423SLionel Sambuc   if ((newmode = atoi(argv[1])) > 0) {
13*99e8768dSDavid van Moolenbroek 	snprintf(cmd, sizeof(cmd), "chmod %d %s", newmode, argv[0]);
14433d6423SLionel Sambuc 	system(cmd);
15433d6423SLionel Sambuc   }
16433d6423SLionel Sambuc 
17433d6423SLionel Sambuc   return(issetugid());
18433d6423SLionel Sambuc }
19