db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramin Moazeni (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2925) Prevent export from overwriting existing files
Date Fri, 13 Jul 2007 18:48:05 GMT

     [ https://issues.apache.org/jira/browse/DERBY-2925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ramin Moazeni updated DERBY-2925:
---------------------------------

    Attachment: DERBY-2925v0.stat
                DERBY-2925v0.diff

Hello,

I am attaching an interim patch for this issue. I am still working on adding
the tests to ImportExportBaseTest.
Your review and feedback is greatly appreciated.

To test the patch:
1) ij>  connect 'jdbc:derby:test1;create=true';
2) create table ex_emp(id int , name char(7) , skills varchar(200), salary decimal(10,2));
3) ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'EX_EMP' , '/home/ramin/emp.dat', null,
null, null);
4) ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'EX_EMP' , '/home/ramin/emp.dat', null,
null, null);
ERROR XSDF0: Could not create file /home/ramin/emp.dat as it already exists.
5) ij> CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE('SELECT * FROM EX_EMP','emp.del',
',' ,'"','UTF-8','pictures.dat');
0 rows inserted/updated/deleted
6) ij> CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE('SELECT * FROM EX_EMP','emp.del',
',' ,'"','UTF-8','pictures.dat');
ERROR XSDF0: Could not create file staff.del as it already exists.
7) ij> CALL SYSCS_UTIL.SYSCS_EXPORT_QUERY_LOBS_TO_EXTFILE('SELECT * FROM EX_EMP','staff.del',
',' ,'"','UTF-8','pictures.dat');
ERROR XSDF0: Could not create file pictures.dat as it already exists.

Thanks
Ramin



> Prevent export from overwriting existing files
> ----------------------------------------------
>
>                 Key: DERBY-2925
>                 URL: https://issues.apache.org/jira/browse/DERBY-2925
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Security, Tools
>    Affects Versions: 10.1.2.1, 10.2.2.0, 10.3.1.3, 10.4.0.0
>            Reporter: Kathey Marsden
>            Assignee: Ramin Moazeni
>         Attachments: DERBY-2925v0.diff, DERBY-2925v0.stat
>
>
> Export should not overwrite existing files, but rather insist that the user remove them
before writing to the file.  This will help prevent accidental or intentional corruption of
the database with export.  This may introduce a compatibility issue with export but because
export is usually an attended utility and not typically invoked as part of an application,
I think the risk is worth the additional security this will provide.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message