fix receiver uid

This commit is contained in:
Afonso Franco 2024-05-12 23:44:19 +01:00
parent f372af3cc3
commit d482e0647f
Signed by: afonso
SSH key fingerprint: SHA256:PQTRDHPH3yALEGtHXnXBp3Orfcn21pK20t0tS1kHg54
3 changed files with 4 additions and 4 deletions

View file

@ -113,7 +113,7 @@ int main(int argc, char *argv[]) {
}
}
int receiverUidInt = atoi("1003");
int receiverUidInt = atoi(receiverUid);
send_message(receiverUidInt,groupFlag);

View file

@ -20,7 +20,7 @@ int main() {
}
// Open the FIFO for reading
if (mkfifo(message_queue_path, 0420) == -1) {
if (mkfifo(message_queue_path, 0660) == -1) {
perror("mkfifo");
exit(EXIT_FAILURE);
}
@ -32,7 +32,7 @@ int main() {
printf("FIFO '%s' does not exist. Exiting...\n", message_queue_path);
return 1;
} else {
perror("open");
perror("open:");
return 1;
}
}

View file

@ -97,7 +97,7 @@ int main() {
exit(EXIT_FAILURE);
}
struct passwd *pw = getpwuid(msg.header.receiver);
struct passwd *pw = getpwuid(msg.header.receiver);
if (pw == NULL) {
fprintf(stderr, "User with uid %d not found\n", msg.header.receiver);
exit(EXIT_FAILURE);