Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 538 forks source link

Safe breakage again #2061

Closed p5pRT closed 14 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#3342 (status was 'resolved')

Searchable as RT3342$

p5pRT commented 24 years ago

From scrytch@uswest.net

Created by chuck@abulafia.localdomain

I submitted a bug about Safe.pm breakage that had several overlapping problems\, but there seems to be a basic problem with using 'use' in a Safe at all. Here's the most minimal test case I could come up with​:

#!/usr/bin/perl

use Safe;

$s = new Safe; $s->deny_only(qw(​:base_math)); # dummy deny\, we're not using any math

$s->reval(q[use FileHandle;]); $@​ and die "can't use​:\n$@​ $!";

outputs the following​:

can't use​: Can't locate object method "unimport" via package "strict" at /usr/local/lib/perl5/5.6.0/FileHandle.pm line 46. BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.0/FileHandle.pm line 46. Compilation failed in require at (eval 2) line 1. BEGIN failed--compilation aborted at (eval 2) line 1.   at ./ts2.pl line 10.

various attempts to work around this problem in the module I'm actually using elsewhere\, Template.pm (which gets pretty much the same errors) by creating an instance outside the safe then sharing it pretty much dies the moment it tries to create new instances\, like Template​::Exception. Besides\, if my users in this template system can't use 'use'\, then I may as well forget it.

was pondering going back to perl5.004_05\, but it doesn't even compile.

Perl Info ``` This perlbug was built using Perl 5.00502 - $Date: 1999/01/17 09:53:34 $ It is being executed now by Perl 5.006 - Mon May 8 16:41:53 MDT 2000. Site configuration information for perl 5.006: Configured by chuck at Mon May 8 16:41:53 MDT 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=freebsd, osvers=4.0-stable, archname=i386-freebsd uname='freebsd abulafia 4.0-stable freebsd 4.0-stable #2: wed may 3 23:08:22 mdt 2000 chuck@abulafia:usrsrcsyscompileabulafia i386 ' config_args='-de' 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='-O', 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='cc', ldflags ='-Wl,-E -L/usr/local/lib' libpth=/usr/lib /usr/local/lib libs=-lgdbm -lm -lc -lcrypt libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-DPIC -fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl 5.006: /usr/local/lib/perl5/5.6.0/i386-freebsd /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/i386-freebsd /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl . Environment for perl 5.006: HOME=/home/chuck LANG (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/chuck/bin:/usr/libexec:/usr/local/libexec:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/games:/usr/java/bin:/usr/local/bin:/usr/X11R6/bin:/opt/apache/bin:/opt/apache_1.3.12/bin:/opt/dev-apache/bin:/opt/mason/bin:/opt/python/bin:/opt/roxen/bin:/usr/X11R6/bin PERL_BADLANG (unset) SHELL=/usr/local/bin/bash ```
p5pRT commented 14 years ago

From @chorny

Rereported as https://rt.cpan.org/Ticket/Display.html?id=56515

-- Alexandr Ciornii\, http​://chorny.net

p5pRT commented 14 years ago

@chorny - Status changed from 'open' to 'resolved'