Subject: | Cannot create a new IO::Pty |
Hi. I'm trying to use IO::Tty in a setuid script but it's crashing. It
works fine non setuid. I have a little C wrapper that posseses the
setuid permission that calls the Perl script. When I run the wrapper as
another user everything works until the new pty creation.
IO::Tty::open_slave(nonfatal): open(/dev/pts/0): Permission denied at
/export/home/user/lib/PA-RISC1.1-thread-multi/IO/Pty.pm line 24.
pty_allocate(nonfatal): open(/dev/ptmx): Permission denied at
/export/home/user/lib/PA-RISC1.1-thread-multi/IO/Pty.pm line 24.
IO::Tty::pty_allocate(nonfatal): grantpt(): Invalid argument at
/export/home/user/lib/PA-RISC1.1-thread-multi/IO/Pty.pm line 24.
IO::Tty::pty_allocate(nonfatal): unlockpt(): Invalid argument at
/export/home/user/lib/PA-RISC1.1-thread-multi/IO/Pty.pm line 24.
IO::Tty::open_slave(nonfatal): open(/dev/pts/0): Permission denied at
/export/home/user/lib/PA-RISC1.1-thread-multi/IO/Pty.pm line 24.
pty_allocate(nonfatal): open(/dev/ptym/clone): Permission denied at
/export/home/user/lib/PA-RISC1.1-thread-multi/IO/Pty.pm line 24.
Cannot create a new IO::Pty from fd 4: Bad file number at
/export/home/user/IDR/IDRconfigdiff.pl line 298
It has to be setuid so that the script users can't directly access
certain information. It just changes to another user ID, not root. The
only related thing I found online was
http://wiki.cpaneldirect.net/wiki/index.php/Cannot_create_a_new_IO::Tty_from_fd_4:_Bad_file_descriptor.
Trying the suggestion there of removing -DHAVE_UNLOCKPT from the make
file made the module non compilable.
# perl -v
This is perl, v5.8.8 built for PA-RISC1.1-thread-multi
(with 26 registered patches, see perl -V for more detail)
Copyright 1987-2006, Larry Wall
Binary build 817 [257965] provided by ActiveState http://www.ActiveState.com
Built Mar 20 2006 19:44:08
# uname -a
HP-UX mse07 B.11.11 U 9000/800 3267743758 unlimited-user license