On 10/07/2015 11:29 AM, Helen Borrie wrote:

> Does anyone have a 2.5.4 on Linux nearby, to test this:
>
> ExternalFileAccess = Restrict /whatever/externalfiles
>
> -- create external table
>
> recreate table ext_log external file '/whatever/log_me.txt'
>    (stamp char(24), message char(100),  CRLF char(2));
> commit;
> -- trigger to autofill some fields
> recreate trigger bi_ext_log for ext_log
> active before insert
> as
> begin
>   if (new.stamp is null) then
>   begin
>    new.stamp = cast (current_timestamp as char(24));
>    new.crlf = ascii_char(13) || ascii_char(10);
> -- take out the ascii_char(13) || if you want to
>   end
> end
> commit;
> --insert some data
> insert into ext_log (message) values('Shall I compare thee to a summer''s 
> day? Thou art more lovely and more temperate.')
> insert into ext_log (message) values('Rough winds do shake the darling buds 
> of May And summer''s lease hath all too short a date.')

Exactly this test certainly does not pass on linux - you try to have 
external file in /whatever, which is out of enabled subtree 
/whatever/externalfiles.
I have
ExternalFileAccess = Restrict /mnt/stg
in firebird.conf and result of test is:

SQL> recreate table ext_log external file '/mnt/log_me.txt'
CON>   (stamp char(24), message char(100),  CRLF char(2));
SQL> set term };
SQL> recreate trigger bi_ext_log for ext_log
CON> active before insert
CON> as
CON> begin
CON>  if (new.stamp is null) then
CON>  begin
CON>   new.stamp = cast (current_timestamp as char(24));
CON>   new.crlf = ascii_char(13) || ascii_char(10);
CON> -- take out the ascii_char(13) || if you want to
CON>  end
CON> end}
SQL> set term ;}
SQL> commit;
SQL> insert into ext_log (message) values('Shall I compare thee to a 
summer''s day? Thou art more lovely and more temperate.');
Statement failed, SQLSTATE = 28000
Access to external file "/mnt/log_me.txt" is denied by server administrator
SQL>

As expected.
If I change test slightly:

SQL> recreate table ext_log external file '/mnt/stg/log_me.txt'
CON>   (stamp char(24), message char(100),  CRLF char(2));
SQL> insert into ext_log (message) values('Shall I compare thee to a 
summer''s day? Thou art more lovely and more temperate.');
SQL>

it does pass OK - also as expected.



------------------------------------------------------------------------------
Full-scale, agent-less Infrastructure Monitoring from a single dashboard
Integrate with 40+ ManageEngine ITSM Solutions for complete visibility
Physical-Virtual-Cloud Infrastructure monitoring from one console
Real user monitoring with APM Insights and performance trend reports 
Learn More http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to