Final?
This commit is contained in:
parent
7e91f16f1c
commit
c84587c9a2
2 changed files with 12 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue