[ic] mv_credit_card_reference

Javier Martin interchange-users@interchange.redhat.com
Wed Oct 17 11:24:01 2001


Quoting Cristopher:

> > > > UserTag web-service Routine <<EOR
> > > > sub {
> > > >
> > > >     my ($url, $code, $message, $data) = @_;
> > > >
> > > >     eval {
> > > >         require LWP::UserAgent;
> > > >         require HTTP::Request::Common;
> > > >     };
> > >
> > > Here is your problem. You can't do a runtime require under Safe.
> >
> > I've taken them out and placed in interchange.cfg but still the same
> > problem. Actually the problem occurs somewhere inside the call to
> > HTTP::Request::Common::POST, so I think that somewhere in the
> > LWP library they require a module in runtime. This looks more
> > difficult to solve, and Christopher's idea of a separate process
> > starts making sense to me.
>
> LWP and HTTP 'use' a raft of other modules.  Find out what they are
> and you should be able to make it work.  Tag or not, write it so
> you can test/develop it externally.  Performance will be much better
> if it is built in and that might matter.  Will 'wget' do?


I think I've found the solution for my tag to work. My problem was that
somewhere in HTTP::Request a runtime 'require' was done, and Safe traps
this. But, why Safe is trapping things in a server-wide UserTag? Because I'm
executing from [perl] ... [/perl] !!  All code inside the [perl] tag is run
through Safe::reval. BUT tags executed directly from their ITL form are not
subjected to the Safe limitations. I have done a quick test, just changing:

  [perl] $Tag->post_something_to("http://www.url.com") [/perl]

to:

  [post-something-to url="http://www.url.com"]

And it works.

Maybe the $Tag->some_tag calls from [perl]...[/perl] should be run through
Safe::Hole?

Javier