Final?
This commit is contained in:
parent
7e91f16f1c
commit
c84587c9a2
2 changed files with 12 additions and 9 deletions
3
Makefile
3
Makefile
|
@ -38,9 +38,12 @@ users:
|
||||||
-sudo useradd -M djumbaiq
|
-sudo useradd -M djumbaiq
|
||||||
-sudo useradd -M djumbaid
|
-sudo useradd -M djumbaid
|
||||||
-sudo groupadd djumbai_queue
|
-sudo groupadd djumbai_queue
|
||||||
|
-sudo groupadd djumbai
|
||||||
-sudo groupadd djumbai_send
|
-sudo groupadd djumbai_send
|
||||||
-sudo usermod -aG djumbai_queue djumbaiq
|
-sudo usermod -aG djumbai_queue djumbaiq
|
||||||
-sudo usermod -aG djumbai_queue djumbaid
|
-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 djumbaid
|
||||||
-sudo usermod -aG djumbai_send root
|
-sudo usermod -aG djumbai_send root
|
||||||
|
|
||||||
|
|
|
@ -99,16 +99,16 @@ int main() {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct passwd *pw = getpwuid(msg.header.receiver);
|
//struct passwd *pw = getpwuid(msg.header.receiver);
|
||||||
if (pw == NULL) {
|
//if (pw == NULL) {
|
||||||
fprintf(stderr, "User with uid %d not found\n", msg.header.receiver);
|
// fprintf(stderr, "User with uid %d not found\n", msg.header.receiver);
|
||||||
exit(EXIT_FAILURE);
|
// exit(EXIT_FAILURE);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (setegid(pw->pw_gid) == -1) {
|
//if (setegid(pw->pw_gid) == -1) {
|
||||||
perror("setgid");
|
// perror("setgid");
|
||||||
exit(EXIT_FAILURE);
|
// exit(EXIT_FAILURE);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect stdin to read from pipe_to_child
|
// Redirect stdin to read from pipe_to_child
|
||||||
|
|
Loading…
Add table
Reference in a new issue