--- rxvt-unicode/src/ptytty.C 2006/01/17 15:17:39 1.40 +++ rxvt-unicode/src/ptytty.C 2006/01/17 15:41:33 1.41 @@ -74,9 +74,7 @@ #ifdef PTYS_ARE_OPENPTY char tty_name[sizeof "/dev/pts/????\0"]; - rxvt_privileges(RESTORE); int res = openpty (&pfd, fd_tty, tty_name, NULL, NULL); - rxvt_privileges(IGNORE); if (res != -1) { @@ -346,8 +344,6 @@ if (!name || !*name) return; - rxvt_privileges (RESTORE); - if (action == SAVE) { # ifndef RESET_TTY_TO_COMMON_DEFAULTS @@ -379,8 +375,6 @@ # endif } - - rxvt_privileges (IGNORE); } #endif @@ -463,7 +457,6 @@ { rxvt_ptytty *id; - rxvt_ptytty_proxy (); ~rxvt_ptytty_proxy (); bool get (); @@ -551,7 +544,6 @@ cmd.hostname[sizeof (cmd.hostname) - 1] = 0; cmd.id->login (cmd.cmd_pid, cmd.login_shell, cmd.hostname); } - else printf ("xxx hiya login no match %p\n", cmd.id); } else if (cmd.type == command::destroy) { @@ -562,7 +554,6 @@ ptys.erase (pty); delete *pty; } - else printf ("xxx hiya destroy no match %p\n", cmd.id); } else break; @@ -594,13 +585,15 @@ } else { + setgid (getegid ()); + setuid (geteuid ()); + // server, pty-helper sock_fd = sv[1]; - close (sv[0]);//D -// for (int fd = 0; fd < 1023; fd++) -// if (fd != sock_fd) -// close (fd); + for (int fd = 0; fd < 1023; fd++) + if (fd != sock_fd) + close (fd); serve (); _exit (EXIT_SUCCESS); @@ -614,10 +607,8 @@ { #if PTYTTY_HELPER if (pid > 0) - { - // use helper process - return new rxvt_ptytty_proxy; - } + // use helper process + return new rxvt_ptytty_proxy; else #endif return new rxvt_ptytty_unix;