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 "Ton Verhagen" <ton@verhagen.net>     ******

Mike,

Thank you for making me understand that the Safe module doesn't
allow object creation.
But am I right in my thinking that UserTags defined in
minivend.cfg are 'global' and can perform any task? Thus anything
'not safe'? In other words, UserTags defined in minivend.cfg
won't be running under the Safe restrictions.
If that's true, than the usertag I defined should work without
having the catalog set to AllowGlobal.

Please correct me if I am wrong as I really would like to
understand this matter.

Thanks


>******    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
>

-
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: