From: Andrew Dunstan Date: Mon, 24 Oct 2005 15:39:50 +0000 (+0000) Subject: Fix incorrect wording about function failure time on unsafe ops - these X-Git-Tag: REL8_1_0RC1~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=24fa8746ae688c1fb2840b65197dfd9cf100c9ed;p=postgresql Fix incorrect wording about function failure time on unsafe ops - these are now caught by the validator. And a small visit from the perl style police: check the return value from open(). --- diff --git a/doc/src/sgml/plperl.sgml b/doc/src/sgml/plperl.sgml index d6f42f294a..9b8b4ceda4 100644 --- a/doc/src/sgml/plperl.sgml +++ b/doc/src/sgml/plperl.sgml @@ -1,5 +1,5 @@ @@ -554,12 +554,16 @@ $$ LANGUAGE plperl; system operations are not allowed for security reasons: CREATE FUNCTION badfunc() RETURNS integer AS $$ - open(TEMP, ">/tmp/badfile"); - print TEMP "Gotcha!\n"; + my $tmpfile = "/tmp/badfile"; + open my $fh, '>', $tmpfile + or elog(ERROR, qq{Could not open the file "$tmpfile": $!}); + print $fh "Testing writing to a file\n"; + close $fh or elog(ERROR, qq{Could not close the file "$tmpfile": $!}); return 1; $$ LANGUAGE plperl; - The creation of the function will succeed, but executing it will not. + The creation of this function will fail as its use of a forbidden + operation will be be caught by the validator.