Fix makefile and fifo path
This commit is contained in:
parent
9b97b40889
commit
b1b05057c8
3 changed files with 15 additions and 11 deletions
20
Makefile
20
Makefile
|
@ -1,5 +1,5 @@
|
||||||
# Compiler
|
# Compiler
|
||||||
CC := /opt/homebrew/opt/llvm/bin/clang
|
CC := gcc
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
CFLAGS := -Wall -Wextra -Werror -Ilibs -fsanitize=address
|
CFLAGS := -Wall -Wextra -Werror -Ilibs -fsanitize=address
|
||||||
|
|
||||||
|
@ -46,18 +46,22 @@ users:
|
||||||
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
-sudo chown djumbaiq $(BINDIR)/djumbai_enqueue/djumbai_enqueue
|
-sudo chown djumbaiq:djumbai $(BINDIR)/djumbai_enqueue/djumbai_enqueue
|
||||||
-sudo chmod u+s $(BINDIR)/djumbai_enqueue/djumbai_enqueue
|
-sudo chmod u+s $(BINDIR)/djumbai_enqueue/djumbai_enqueue
|
||||||
-sudo chown djumbaid $(BINDIR)/djumbai_dequeue/djumbai_dequeue
|
-sudo chown djumbaid:djumbai_queue $(BINDIR)/djumbai_dequeue/djumbai_dequeue
|
||||||
-sudo chmod u+s $(BINDIR)/djumbai_dequeue/djumbai_dequeue
|
-sudo chmod u+s $(BINDIR)/djumbai_dequeue/djumbai_dequeue
|
||||||
-sudo chown root $(BINDIR)/djumbai_send/djumbai_send
|
-sudo chown root:djumbai_send $(BINDIR)/djumbai_send/djumbai_send
|
||||||
-sudo chmod u+s $(BINDIR)/djumbai_send/djumbai_send
|
-sudo chmod u+s $(BINDIR)/djumbai_send/djumbai_send
|
||||||
|
|
||||||
directories:
|
directories:
|
||||||
-sudo -u root -g djumbai mkdir /opt/djumbai
|
-sudo mkdir -m 050 /opt/djumbai
|
||||||
-sudo -u root -g djumbai mkdir /opt/djumbai/fifos
|
-sudo mkdir -m 070 /opt/djumbai/fifos
|
||||||
-sudo -u root -g djumbai mkdir /opt/djumbai/user
|
-sudo mkdir -m 070 /opt/djumbai/user
|
||||||
-sudo -u root -g djumbai mkdir /opt/djumbai/group
|
-sudo mkdir -m 070 /opt/djumbai/group
|
||||||
|
-sudo chown nobody:djumbai /opt/djumbai
|
||||||
|
-sudo chown nobody:djumbai /opt/djumbai/fifos
|
||||||
|
-sudo chown nobody:djumbai /opt/djumbai/user
|
||||||
|
-sudo chown nobody:djumbai /opt/djumbai/group
|
||||||
|
|
||||||
setup: users permissions directories
|
setup: users permissions directories
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
int main() {
|
int main() {
|
||||||
// Change the root of the process so it doesn't have access to anything else.
|
// Change the root of the process so it doesn't have access to anything else.
|
||||||
chroot("/opt/djumbai/");
|
chroot("/opt/djumbai/");
|
||||||
const char *message_queue_path = "fifos/message_queue";
|
const char *message_queue_path = "/opt/djumbai/fifos/message_queue";
|
||||||
|
|
||||||
if (access(message_queue_path, F_OK) != -1) {
|
if (access(message_queue_path, F_OK) != -1) {
|
||||||
// FIFO exists, delete it
|
// FIFO exists, delete it
|
||||||
|
|
|
@ -13,7 +13,7 @@ int main() {
|
||||||
|
|
||||||
// Open the FIFO for writing
|
// Open the FIFO for writing
|
||||||
chroot("/opt/djumbai/");
|
chroot("/opt/djumbai/");
|
||||||
const char *send_fifo_path = "fifos/send_fifo";
|
const char *send_fifo_path = "/opt/djumbai/fifos/send_fifo";
|
||||||
if (access(send_fifo_path, F_OK) != -1) {
|
if (access(send_fifo_path, F_OK) != -1) {
|
||||||
// FIFO exists, delete it
|
// FIFO exists, delete it
|
||||||
if (unlink(send_fifo_path) == -1) {
|
if (unlink(send_fifo_path) == -1) {
|
||||||
|
|
Loading…
Reference in a new issue