This commit is contained in:
Afonso Franco 2024-05-12 23:57:59 +01:00
parent 7e91f16f1c
commit c84587c9a2
Signed by: afonso
SSH key fingerprint: SHA256:PQTRDHPH3yALEGtHXnXBp3Orfcn21pK20t0tS1kHg54
2 changed files with 12 additions and 9 deletions

View file

@ -38,9 +38,12 @@ users:
-sudo useradd -M djumbaiq
-sudo useradd -M djumbaid
-sudo groupadd djumbai_queue
-sudo groupadd djumbai
-sudo groupadd djumbai_send
-sudo usermod -aG djumbai_queue djumbaiq
-sudo usermod -aG djumbai_queue djumbaid
-sudo usermod -aG djumbai djumbaiq
-sudo usermod -aG djumbai djumbaid
-sudo usermod -aG djumbai_send djumbaid
-sudo usermod -aG djumbai_send root

View file

@ -99,16 +99,16 @@ int main() {
exit(EXIT_FAILURE);
}
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);
}
//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);
//}
if (setegid(pw->pw_gid) == -1) {
perror("setgid");
exit(EXIT_FAILURE);
}
//if (setegid(pw->pw_gid) == -1) {
// perror("setgid");
// exit(EXIT_FAILURE);
//}
}
// Redirect stdin to read from pipe_to_child