minix3/tests/t60a.c

19 lines
345 B
C
Raw Normal View History

2020-02-21 00:59:27 +05:30
#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());
}