mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-11 23:57:31 +08:00
> I've worked with the Pl/Python code in the past and will see about removing
> rexec and making it an untrusted language. Last time I looked, it didn't > look particularly difficult. I've set aside some time next week, so stay > tuned. Attached is a patch that removes all of the RExec code from plpython from the current PostgreSQL CVS. In addition, plpython needs to be changed to an untrusted language in createlang. Please let me know if there are any problems. Kevin Jacobs
This commit is contained in:
@ -34,7 +34,7 @@ return SD["call"]
|
||||
CREATE FUNCTION import_fail() returns text
|
||||
AS
|
||||
'try:
|
||||
import socket
|
||||
import foosocket
|
||||
except Exception, ex:
|
||||
plpy.notice("import socket failed -- %s" % str(ex))
|
||||
return "failed as expected"
|
||||
@ -304,30 +304,5 @@ CREATE OR REPLACE FUNCTION read_file(text) RETURNS text AS '
|
||||
|
||||
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 'plpython';
|
||||
|
||||
CREATE OR REPLACE FUNCTION getpid() RETURNS int4 AS '
|
||||
import os
|
||||
return os.getpid()
|
||||
' LANGUAGE 'plpython';
|
||||
|
||||
CREATE OR REPLACE FUNCTION uname() RETURNS int4 AS '
|
||||
import os
|
||||
return os.uname()
|
||||
' LANGUAGE 'plpython';
|
||||
|
||||
CREATE OR REPLACE FUNCTION sys_exit() RETURNS text AS '
|
||||
import sys
|
||||
return sys.exit()
|
||||
' LANGUAGE 'plpython';
|
||||
|
||||
CREATE OR REPLACE FUNCTION sys_argv() RETURNS text AS '
|
||||
import sys
|
||||
return str(sys.argv)
|
||||
' LANGUAGE 'plpython';
|
||||
|
||||
CREATE OR REPLACE FUNCTION sys_version() RETURNS text AS '
|
||||
import sys
|
||||
return str(sys.version)
|
||||
' LANGUAGE 'plpython';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user