this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement sandbox_note() and _amkrtemp()

+10 -3
+10 -3
src/sandbox/sandbox.c
··· 2 2 #include <stddef.h> 3 3 #include <string.h> 4 4 #include <stdlib.h> 5 + #include <stdio.h> 5 6 #include <sys/types.h> 6 7 7 8 // DUMMY implementation ··· 67 68 68 69 int sandbox_note(const char *note) 69 70 { 70 - return -1; 71 + printf("%s\n", note); 72 + return 0; 71 73 } 72 74 73 75 int sandbox_suspend(pid_t pid) ··· 131 133 return -1; 132 134 } 133 135 134 - const char *_amkrtemp(const char *unused) 136 + const char *_amkrtemp(const char *path) 135 137 { 136 - return NULL; 138 + size_t len = strlen(path); 139 + const char suffix[] = ".amkrtempXXXXXX"; 140 + char *template = malloc(len + sizeof(suffix)); 141 + memcpy(template, path, len); 142 + memcpy(template + len, suffix, sizeof(suffix)); 143 + return mktemp(template); 137 144 } 138 145 139 146 int rootless_allows_task_for_pid(pid_t pid) {