Hi,
my open2 script failes to work under mod_perl with perl v5.6.0. Works correctly
outside of the 5.6.0-mod_perl environment but works with mod_perl-5.005_03.
The code comes from '/usr/sbin/adduser'.
There are no errors, only the 'RD' handle returns "". As I said works
everywhere else but mod_perl-1.24 with perl v5.6.0.
This is perl, v5.6.0 built for i386-openbsd
Server: Apache/1.3.12 (Unix) mod_perl/1.24
OpenBSD entropic 2.7 entropic#0 i386
Is this a know bug? Is there a bug? Is it right in front of my face?
Workarounds? .... thanks, Wendell
*** script is as follows. and a full perl -V follows further ...
use IPC::Open2;
use strict;
print encrypt("thisisapassword");
sub encrypt {
my $pass = shift;
my $salt = &salt;
my $args = "-b $salt";
my $crypt;
open2(\*ENCRD, \*ENCWR, "/usr/bin/encrypt $args")
or die("Can't open2: '/usr/bin/encrypt': $!");
print ENCWR "$pass\n";
close ENCWR;
$crypt = <ENCRD>;
close ENCRD;
chomp $crypt;
die "encrypt failed" if (wait == -1 || $? != 0);
return($crypt);
}
sub salt { 7 }
__END__
# perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=openbsd, osvers=2.7, archname=i386-openbsd
uname='openbsd'
config_args='-Dopenbsd_distribution=defined -dsE'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
Compiler:
cc='cc', optimize='-O2', gccversion=2.95.2 19991024 (release)
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccflags ='-fno-strict-aliasing -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=true
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='ld', ldflags =''
libpth=/usr/lib
libs=-lm -lc
libc=/usr/lib/libc.so.25.0, so=so, useshrplib=true, libperl=libperl.so.6.0
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=define, ccdlflags=' '
cccdlflags='-DPIC -fPIC ', lddlflags='-Bshareable '
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under openbsd
Compiled at Jun 4 2000 15:10:45
@INC:
/usr/libdata/perl5/i386-openbsd/5.6.0
/usr/local/libdata/perl5/i386-openbsd/5.6.0
/usr/libdata/perl5
/usr/local/libdata/perl5
/usr/local/libdata/perl5/site_perl/i386-openbsd
/usr/libdata/perl5/site_perl/i386-openbsd
/usr/local/libdata/perl5/site_perl
/usr/libdata/perl5/site_perl
/usr/lib/perl5/site_perl
.