-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtarget_mkdir.c
More file actions
34 lines (31 loc) · 830 Bytes
/
target_mkdir.c
File metadata and controls
34 lines (31 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/prctl.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <sys/wait.h>
#include <stddef.h>
#include <stdbool.h>
#include <linux/audit.h>
#include <sys/syscall.h>
#include <sys/stat.h>
#include <linux/filter.h>
#include <linux/seccomp.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv) {
int s;
for (char **ap = argv+1; *ap != NULL; ap++) {
printf("\nTarget process: about to make directory \"%s\"\n", *ap);
s = mkdir(*ap, 0600);
if (s == -1)
perror("Target process: mkdir");
else
printf("Target process: SUCCESS: mkdir(2) returned = %d\n", s);
}
printf("Target process: terminating\n");
exit(EXIT_SUCCESS);
}