… | … | ||
---|---|---|---|
636 | close (sv[1]); | 636 | close (sv[1]); |
637 | fcntl (sock_fd, F_SETFD, FD_CLOEXEC); | 637 | fcntl (sock_fd, F_SETFD, FD_CLOEXEC); |
638 | } | 638 | } |
639 | else | 639 | else |
640 | { | 640 | { |
641 | setgid (getegid ()); | ||
642 | setuid (geteuid ()); | ||
643 | |||
644 | // server, pty-helper | 641 | // server, pty-helper |
645 | sock_fd = sv[1]; | 642 | sock_fd = sv[1]; |
646 | 643 | ||
647 | for (int fd = 0; fd < 1023; fd++) | 644 | for (int fd = 0; fd < 1023; fd++) |
648 | if (fd != sock_fd && fd != 1) | 645 | if (fd != sock_fd) |
649 | close (fd); | 646 | close (fd); |
650 | 647 | ||
651 | serve (); | 648 | serve (); |
652 | _exit (EXIT_SUCCESS); | 649 | _exit (EXIT_SUCCESS); |
653 | } | 650 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |