diff --git a/src/djumbai_dequeue/djumbai_dequeue.c b/src/djumbai_dequeue/djumbai_dequeue.c index 1484cd0..fef724a 100644 --- a/src/djumbai_dequeue/djumbai_dequeue.c +++ b/src/djumbai_dequeue/djumbai_dequeue.c @@ -10,8 +10,8 @@ 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) { + chdir("/opt/djumbai"); + if (chroot("/opt/djumbai") != 0) { perror("chroot /opt/djumbai"); return 1; } diff --git a/src/djumbai_send/djumbai_send.c b/src/djumbai_send/djumbai_send.c index 212c0e3..9e1258c 100644 --- a/src/djumbai_send/djumbai_send.c +++ b/src/djumbai_send/djumbai_send.c @@ -10,23 +10,6 @@ #include int main() { - // Get the UID of the djumbaid user. - const char *djumbaid_username = "djumbaid"; - - struct passwd *pw = getpwnam(djumbaid_username); - if (pw == NULL) { - fprintf(stderr, "User %s not found\n", djumbaid_username); - exit(EXIT_FAILURE); - } - - //Store previous UID - uid_t original_euid = geteuid(); - // Set UID to djumbaid - if (seteuid(pw->pw_uid) == -1) { - perror("setuid"); - exit(EXIT_FAILURE); - } - chdir("/opt/djumbai/"); if (chroot("/opt/djumbai/") != 0) { perror("chroot /opt/djumbai"); @@ -60,11 +43,6 @@ int main() { return 1; } } - //Restore previous UID - if (seteuid(original_euid) == -1) { - perror("Restore original euid"); - exit(EXIT_FAILURE); - } while (1) { // Read message from the send_fifo