...что-то не работает:
Код: Выделить всё
use IPC::Run qw(run timeout start harness);
my @cmd;
push @cmd, "/usr/bin/su";
my $in = "passwd";
my $out="";
my $err="";
# my $h = run3 \@cmd,\$in,\$out,\$err; #timeout('30'); #timeout($self->{_timeout});
start \@cmd, '<pty<', \$in, '>pty>', \$out, '2>', \$err;
printf STDERR "\n\n> output: %s \n> result: %s\n\n",$out,$?;
print $err;
в auth.log ошибка:
если так:
Код: Выделить всё
# my $h = run3 \@cmd,\$in,\$out,\$err; #timeout('30'); #timeout($self->{_timeout});
если так:Sep 23 21:11:48 the su: in prompt_echo_off(): tcgetattr(): Inappropriate ioctl for device
Sep 23 21:11:48 the su: BAD SU ddd to root on tty
Код: Выделить всё
start \@cmd, '<pty<', \$in, '>pty>', \$out, '2>', \$err;
OS: FreeBSDSep 23 22:27:56 the su: in prompt_echo_off(): tcgetattr(): Device not configured
Sep 23 22:27:56 the su: BAD SU ddd to root on tty
вообщем, решение не нашел и не понял, почему так... вродебы все правильно..


