[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

PlRuby(Postgres) and require

Bertram Scharpf

1/9/2007 2:10:00 PM

Hi,

in PlRuby I am defining functions and I would like to load
some library:

create function dummy() returns void language 'plruby' as $$
require "yaml"
$$;
select dummy();

This yields in an "ERROR: Insecure operation - require". At
least the string "yaml"s tainted state is a reason for this.
Inside the library classes will be defined (i.e. constants
will be set) what is prohibited, too.

It is a very easy excercise to modify the PlRuby library so
that it loads "yaml" before $SAFE is set. But then the
system is no longer compatible to others. The question I
would like to ask therefore is more elaborate:

What other ways are there and which is the _best_ way to
include a library?

Thanks in advance,

Bertram


--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-...

2 Answers

ts

1/9/2007 2:58:00 PM

0

>>>>> "B" == Bertram Scharpf <lists@bertram-scharpf.de> writes:

B> This yields in an "ERROR: Insecure operation - require". At

By default, plruby run with $SAFE = 12

B> What other ways are there and which is the _best_ way to
B> include a library?

You have 2 possibilities

* compile plruby with $SAFE = 0

ruby extconf.rb --with-safe-level=0 ...

* look in the directories src/conversions to see what it do in some
special cases.


Guy Decoux



Bertram Scharpf

1/11/2007 8:07:00 AM

0

Hi Guy,

Am Dienstag, 09. Jan 2007, 23:58:18 +0900 schrieb ts:
> >>>>> "B" == Bertram Scharpf <lists@bertram-scharpf.de> writes:
>
> B> This yields in an "ERROR: Insecure operation - require". At
>
> By default, plruby run with $SAFE = 12

Of course, I do not want to change this. So, I will extend
the local package.

The class I wrote was a small checksum algorithm for 'check'
constraints. Maybe I wil make it subject to an extension
proposal sometimes.

Thanks.

Bertram


--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-...