minix/minix/tests/t60a.c
Lionel Sambuc 433d6423c3 New sources layout
Change-Id: Ic716f336b7071063997cf5b4dae6d50e0b4631e9
2014-07-31 16:00:30 +02:00

19 lines
345 B
C

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
/* Return our tainted state to the parent */
int newmode;
char cmd[30];
if (argc < 2) return(-2);
if ((newmode = atoi(argv[1])) > 0) {
snprintf(cmd, sizeof(cmd), "chmod %o %s", newmode, argv[0]);
system(cmd);
}
return(issetugid());
}