Change base dir to /djumbai instead of /opt/djumbai
This commit is contained in:
parent
5c28fe0531
commit
21a222d855
6 changed files with 22 additions and 23 deletions
|
@ -42,7 +42,7 @@ int main() {
|
|||
deserialize_message(buffer, MESSAGE_SIZE, &msg);
|
||||
|
||||
if (msg.header.isgroup) {
|
||||
const char *directory_format = "/opt/djumbai/group/%d/message_box";
|
||||
const char *directory_format = "/djumbai/group/%d/message_box";
|
||||
char directory[PATH_MAX];
|
||||
snprintf(directory, sizeof(directory), directory_format, msg.header.receiver);
|
||||
|
||||
|
@ -58,7 +58,7 @@ int main() {
|
|||
write_message_to_file(directory, timestamp_str, 0020, buffer);
|
||||
|
||||
} else {
|
||||
const char *directory_format = "/opt/djumbai/user/%d/message_box/%d";
|
||||
const char *directory_format = "/djumbai/user/%d/message_box/%d";
|
||||
char directory[PATH_MAX];
|
||||
snprintf(directory, sizeof(directory), directory_format, msg.header.receiver,
|
||||
msg.header.sender);
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
|
||||
int main() {
|
||||
// Change the root of the process so it doesn't have access to anything else.
|
||||
|
||||
chdir("/opt/djumbai");
|
||||
if (chroot("/opt/djumbai") != 0) {
|
||||
perror("chroot /opt/djumbai");
|
||||
chdir("/djumbai");
|
||||
if (chroot("/djumbai") != 0) {
|
||||
perror("chroot /djumbai");
|
||||
return 1;
|
||||
}
|
||||
const char *message_queue_path = "fifos/message_queue";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
int main() {
|
||||
//Change the root of the djumbai_enqueue process so it doesn't have access to anything else.
|
||||
chroot("/opt/djumbai/queue/");
|
||||
chroot("/djumbai/queue/");
|
||||
const char *message_queue_path =
|
||||
"mailqueue";
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
chdir("/opt/djumbai/");
|
||||
if (chroot("/opt/djumbai/") != 0) {
|
||||
perror("chroot /opt/djumbai");
|
||||
chdir("/djumbai/");
|
||||
if (chroot("/djumbai/") != 0) {
|
||||
perror("chroot /djumbai");
|
||||
return 1;
|
||||
}
|
||||
const char *send_fifo_path = "fifos/send_fifo";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue