IO-Tty
view release on metacpan or search on metacpan
if (print_debug)
fprintf(stderr, "trying seteuid() from %d to %d...\n",
euid, uid);
#endif
if (setuid(uid)) {
warn("ERROR: IO::Tty::open_slave: couldn't seteuid to root: %d", errno);
close(*ptyfd);
*ptyfd = -1;
return 0;
}
if (chown(namebuf, euid, -1)) {
warn("ERROR: IO::Tty::open_slave: couldn't fchown the pty: %d", errno);
close(*ptyfd);
*ptyfd = -1;
return 0;
}
if (seteuid(euid)) {
warn("ERROR: IO::Tty::open_slave: couldn't seteuid back: %d", errno);
close(*ptyfd);
*ptyfd = -1;
return 0;
}
( run in 1.115 second using v1.01-cache-2.11-cpan-71847e10f99 )