aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-06-20 21:14:01 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-06-20 21:14:01 +0000
commit59ee9448a86acd1de8d8eaf2cc86b1ea45f54069 (patch)
treeb2fa48d9cbc664c03262afa503f6174b1eb38915 /src
parent9d7c005243c55fef3ee359c6e2a076ff202ad7a3 (diff)
downloadpostgresql-59ee9448a86acd1de8d8eaf2cc86b1ea45f54069.tar.gz
postgresql-59ee9448a86acd1de8d8eaf2cc86b1ea45f54069.zip
Remove read_file/write_file tests. These were originally intended to
*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.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpython/expected/plpython_error.out13
-rw-r--r--src/pl/plpython/expected/plpython_function.out7
-rw-r--r--src/pl/plpython/sql/plpython_error.sql4
-rw-r--r--src/pl/plpython/sql/plpython_function.sql9
4 files changed, 0 insertions, 33 deletions
diff --git a/src/pl/plpython/expected/plpython_error.out b/src/pl/plpython/expected/plpython_error.out
index f2bf34f996a..06043289fed 100644
--- a/src/pl/plpython/expected/plpython_error.out
+++ b/src/pl/plpython/expected/plpython_error.out
@@ -19,16 +19,3 @@ SELECT valid_type('rick');
(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)
-
diff --git a/src/pl/plpython/expected/plpython_function.out b/src/pl/plpython/expected/plpython_function.out
index def301affb1..cc1415dca8d 100644
--- a/src/pl/plpython/expected/plpython_function.out
+++ b/src/pl/plpython/expected/plpython_function.out
@@ -255,13 +255,6 @@ for r in rv:
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
--
diff --git a/src/pl/plpython/sql/plpython_error.sql b/src/pl/plpython/sql/plpython_error.sql
index f1939eb8ffb..2f0486fed92 100644
--- a/src/pl/plpython/sql/plpython_error.sql
+++ b/src/pl/plpython/sql/plpython_error.sql
@@ -7,7 +7,3 @@ SELECT invalid_type_uncaught('rick');
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');
diff --git a/src/pl/plpython/sql/plpython_function.sql b/src/pl/plpython/sql/plpython_function.sql
index c849c3e5b97..25ac388495a 100644
--- a/src/pl/plpython/sql/plpython_function.sql
+++ b/src/pl/plpython/sql/plpython_function.sql
@@ -298,15 +298,6 @@ 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
--