Remove chroot from some processes
This commit is contained in:
parent
21a222d855
commit
b6e33c1052
2 changed files with 3 additions and 11 deletions
|
@ -8,13 +8,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
// Change the root of the process so it doesn't have access to anything else.
|
||||
chdir("/djumbai");
|
||||
if (chroot("/djumbai") != 0) {
|
||||
perror("chroot /djumbai");
|
||||
return 1;
|
||||
}
|
||||
const char *message_queue_path = "fifos/message_queue";
|
||||
const char *message_queue_path = "/djumbai/fifos/message_queue";
|
||||
|
||||
if (access(message_queue_path, F_OK) != -1) {
|
||||
// FIFO exists, delete it
|
||||
|
@ -44,7 +38,7 @@ int main() {
|
|||
}
|
||||
|
||||
// Open the FIFO for writing
|
||||
const char *send_fifo_path = "fifos/send_fifo";
|
||||
const char *send_fifo_path = "/djumbai/fifos/send_fifo";
|
||||
int send_fifo_fd;
|
||||
send_fifo_fd = open(send_fifo_path, O_WRONLY);
|
||||
if (send_fifo_fd == -1) {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
#include "djumbai_enqueue.h"
|
||||
|
||||
int main() {
|
||||
//Change the root of the djumbai_enqueue process so it doesn't have access to anything else.
|
||||
chroot("/djumbai/queue/");
|
||||
const char *message_queue_path =
|
||||
"mailqueue";
|
||||
"/djumbai/fifos/mailqueue";
|
||||
|
||||
// Open the FIFO for writing
|
||||
int queue_fd;
|
||||
|
|
Loading…
Reference in a new issue