Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] 4.02 UserTag implementation misbehaving?



******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******

Quoting Ton Verhagen (ton@verhagen.net):
> As far as I understand the docs:
> - UserTags defined in minivend.cfg are global and can do all kind
> of 'UnSafe' stuff;
> - UserTags defined in catalog.cfg are restricted by the Safe
> module;
> 
> If the above is correct (which I believe) than I do not
> understand why the following UserTag (defined in minivend.cfg)
> gets trapped by the Safe module.
> (Error message: ...Safe: Can't locate object method "Dumpxs" via
> package "Data::Dumper" at
> /usr/lib/perl5/5.00503/i386-linux/Data/Dumper.pm line 429.)
> 
> UserTag my_uneval Order ref
> UserTag my_uneval Routine <<EOR
> sub {
>    return Vend::Util::uneval(@_);
> }
> EOR
> 
> Called on a page like:
> [perl]
>    ...
>    return $Tag->my_uneval({ref=>$someref});
> [/perl]

This is because object creation (which the uneval routine does) is
not allowed in Safe. If you use the 'uneval_it' routine you will
not see this, because it creates no objects.

This bedeviled me with SQL for some time; basically, it was impossible
to use SQL databases inside embedded Perl code. Fortunately, Sey Nakajima
made the Safe::Hole module, which solves that problem, mostly. But it
doesn't solve that one.

Best,
Mike
-- 
Internet Robotics, 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mikeh@minivend.com>

Any man who is under 30, and is not liberal, has not heart; and any man
who is over 30, and is not a conservative, has not brains.
 -- Winston Churchill
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: