| skipped 6 lines |
7 | 7 | | #include <errno.h> |
8 | 8 | | #include <fcntl.h> |
9 | 9 | | #include <unistd.h> |
10 | | - | |
| 10 | + | #include <sys/mount.h> |
11 | 11 | | #include "log.h" |
12 | 12 | | #include "simple_xattr.h" |
13 | 13 | | |
| skipped 3 lines |
17 | 17 | | */ |
18 | 18 | | void spray_simple_xattr(char *filename, uint32_t spray_size) { |
19 | 19 | | |
20 | | - | char command[COMMAND_MAX_LEN]; |
21 | 20 | | char attribute_name[ATTRIBUTE_NAME_LEN]; |
22 | 21 | | |
23 | 22 | | /* Mount a new tmpfs to be able to set security xattr */ |
24 | 23 | | if (mkdir("/tmp/tmpfs", S_IRWXU) == -1 && errno != EEXIST) |
25 | 24 | | do_error_exit("mkdir"); |
26 | 25 | | |
27 | | - | system("mount -t tmpfs none /tmp/tmpfs"); |
28 | | - | |
| 26 | + | if (mount(NULL, "/tmp/tmpfs", "tmpfs", 0, NULL) == -1) |
| 27 | + | { |
| 28 | + | do_error_exit("mount"); |
| 29 | + | } |
29 | 30 | | /* Create a file to the set attributes */ |
30 | 31 | | int fd = creat(filename, 0644); |
31 | 32 | | close(fd); |
| skipped 19 lines |