Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe module & share #2118

Closed
p5pRT opened this issue Jun 21, 2000 · 1 comment
Closed

Safe module & share #2118

p5pRT opened this issue Jun 21, 2000 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Jun 21, 2000

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

Searchable as RT3409$

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2000

From peter.vanbiesen@vlafo.be

Created by pvbiesen@xs4all.be

Hi,

I tried to share a variable with a compartment, but I noticed this
didn't work.
I searched the web for a solution, but only found another bugreport from

decoux@​moulon.inra.fr, dating Sun, 31 May 1998 15​:51​:20 +0200 (MET DST)​:

This is a bug report for perl from decoux@​moulon.inra.fr,
generated with the help of perlbug 1.20 running under perl 5.00404.

perldoc Safe say :

  Consider a function foo() in package pkg compiled
  outside a compartment but shared with it. Assume the
  compartment has a root package called 'Root'. If
  foo() contains an eval statement like eval '$foo =
  1' then, normally, $pkg​::foo will be set to 1. If
  foo() is called from the compartment (by whatever
  means) then instead of setting $pkg​::foo, the eval
  will actually set $Root​::pkg​::foo.

but

moulon% cat a.pl
#!/usr/bin/perl
use Safe;
package pkg;

sub foo {
  eval '$foo = 1';
}

my $c = Safe->new('Root');
$c->share('&foo');
$pkg​::foo = 2;
print "$pkg​::foo -- $Root​::pkg​::foo\n";
$c->reval('foo()') || die $@​;
print "$pkg​::foo -- $Root​::pkg​::foo\n";
moulon% a.pl
2 --
1 --
moulon%

Same with 5.004_66

Guy Decoux
<<<

This report was for a 5.004 version. I tried the code in the bugreport
on
my 5.005, and this gave the same error.

This is only a reminder that this doesn't work either in version 5.005.

Kindest regards,

Perl Info

---
Site configuration information for perl 5.00503:

Configured by root at Thu Mar 16 09:48:33 MET 2000.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=hpux, osvers=11.00, archname=PA-RISC1.1
    uname='hp-ux vfsi4 b.11.00 a 9000778 2016310320 two-user license '
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.95.2 19991024 (release)
    cppflags='-D_HPUX_SOURCE'
    ccflags ='-D_HPUX_SOURCE'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib/pa1.1 /lib /usr/lib /usr/ccs/lib
    libs=-lnsl -lnm -lndbm -ldld -lm -lc -lndir -lcrypt
    libc=/lib/libc.sl, so=sl, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-B,deferred '
    cccdlflags='-fpic', lddlflags='-b -L/usr/local/lib'

Locally applied patches:


---
@INC for perl 5.00503:
    /opt/perl/lib/5.00503/PA-RISC1.1
    /opt/perl/lib/5.00503
    /opt/perl/lib/site_perl/5.005/PA-RISC1.1
    /opt/perl/lib/site_perl/5.005
    .

---
Environment for perl 5.00503:
    HOME=/users/pxv
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=.:/opt/gcc/bin:/opt/xv/bin/X11:/opt/perl/bin:/opt/netscape:/opt/asu/lanman/bin:/opt/informix/bin:/opt/xemacs/bin:/opt/Acrobat4/bin:/bin:/usr/bin:/usr/dt/bin:/usr/bin/X11:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/bin:/usr/contrib/bin/X11:/opt/upgrade/bin:/usr/sbin:/opt/ignite/bin:/opt/perf/bin:/opt/hparray/bin:/opt/fc/bin:/opt/fcms/bin

    PERL_BADLANG (unset)
    SHELL=/usr/bin/ksh


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant