*fail*, to test that plpython didn't allow untrusted operations.
When we changed plpython to plpythonu because python didn't actually have
a secure sandbox mode, someone (probably me :-() misinterpreted the tests
as checking whether Python's file I/O works. Which is a stupid thing for
us to be testing. Remove it so we don't clutter the filesystem with
random temporary files.
(1 row)
--- Security sandbox tests
-SELECT write_file('/tmp/plpython','Only trusted users should be able to do this!');
- write_file
-------------------------------
- Wrote to file: /tmp/plpython
-(1 row)
-
-SELECT read_file('/tmp/plpython');
- read_file
------------------------------------------------
- Only trusted users should be able to do this!
-(1 row)
-
return seq
'
LANGUAGE plpythonu;
-CREATE OR REPLACE FUNCTION read_file(text) RETURNS text AS '
- return open(args[0]).read()
-' LANGUAGE plpythonu;
-CREATE OR REPLACE FUNCTION write_file(text,text) RETURNS text AS '
- open(args[0],"w").write(args[1])
- return "Wrote to file: %s" % args[0]
-' LANGUAGE plpythonu;
--
-- Universal Newline Support
--
SELECT invalid_type_caught('rick');
SELECT invalid_type_reraised('rick');
SELECT valid_type('rick');
-
--- Security sandbox tests
-SELECT write_file('/tmp/plpython','Only trusted users should be able to do this!');
-SELECT read_file('/tmp/plpython');
'
LANGUAGE plpythonu;
-CREATE OR REPLACE FUNCTION read_file(text) RETURNS text AS '
- return open(args[0]).read()
-' LANGUAGE plpythonu;
-
-CREATE OR REPLACE FUNCTION write_file(text,text) RETURNS text AS '
- open(args[0],"w").write(args[1])
- return "Wrote to file: %s" % args[0]
-' LANGUAGE plpythonu;
-
--
-- Universal Newline Support
--