You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Jeffrey Lichtman <sw...@rcn.com> on 2006/02/07 03:46:45 UTC

Re: [jira] Commented: (DERBY-304) If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until windows crashes!

I haven't been following this thread very closely, so please forgive 
me if this has already been considered. I assume the problem is that 
the backup algorithm creates a directory to contain the backup, so if 
the location of the backup is in the database it tries to copy the 
contents of the backup into itself.

Would it work to make a list of the contents of the database before 
creating the backup directory, and then make the algorithm work off 
the list? I suppose it would be better to keep the user from putting 
the backup in the database, but that isn't always easy to prevent.


                        -        Jeff Lichtman
                                 swazoo@rcn.com
                                 Check out Swazoo Koolak's Web Jukebox at
                                 http://swazoo.com/ 


Re: [jira] Commented: (DERBY-304) If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until windows crashes!

Posted by Mike Matrigali <mi...@sbcglobal.net>.
Good, I was thinking that your online backup changes had probably
changed the behavior of the recursive copy - maybe why you were seeing
the reported problem.

I think what you describe below plus the check that Dan suggested about
figuring out if the destination is a db is a reasonable error check for
bad user input in this case.  Also it would be good to make sure the
documentation of the various procedures is clear about not backing up
the db into the db itself or another db.

As you say grant/revoke may eventually make sure only the right people
are executing the backup.

Suresh Thalamati wrote:

> Thanks Jeff, I agree with you, By making the list of all the contents of
> the database that need to go into the backup before creating backup
> directory will  avoid the backup copying onto itself  and going into end
> less recursion
> 
> After my recent online backup changes, only the jar directory really
> uses recursive copy of directories because it has sub directories with
> schema names. One could just find the contents of this directory before
> creating the backup directory.  And also just copy only files with "jar"
> suffix that are created by the database engine in the sub directories
> and ignore the user created files with any other extensions in these
> directories.
> 
> I was hoping to find out some sure way to prevent users creating backup
> in the database directories, looks like there is not one without
> enforcing some special Security Permissions. Hopefully
> with GRANT/REVOKE feature , an administrator of the database can
> limit the users who can execute backup procedures.
> 
> 
> Thanks
> -surest
> 
> Jeffrey Lichtman wrote:
> 
>> I haven't been following this thread very closely, so please forgive
>> me if this has already been considered. I assume the problem is that
>> the backup algorithm creates a directory to contain the backup, so if
>> the location of the backup is in the database it tries to copy the
>> contents of the backup into itself.
>>
>> Would it work to make a list of the contents of the database before
>> creating the backup directory, and then make the algorithm work off
>> the list? I suppose it would be better to keep the user from putting
>> the backup in the database, but that isn't always easy to prevent.
>>
>>
>>                        -        Jeff Lichtman
>>                                 swazoo@rcn.com
>>                                 Check out Swazoo Koolak's Web Jukebox at
>>                                 http://swazoo.com/
>>
> 
> 

Re: [jira] Commented: (DERBY-304) If by mistake you give he location for the db backup as the db itself , then windows created directories recursively until windows crashes!

Posted by Suresh Thalamati <su...@gmail.com>.
Thanks Jeff, I agree with you, By making the list of all the contents 
of the database that need to go into the backup before creating backup 
directory will  avoid the backup copying onto itself  and going into 
end less recursion

After my recent online backup changes, only the jar directory really 
uses recursive copy of directories because it has sub directories with 
schema names. One could just find the contents of this directory 
before creating the backup directory.  And also just copy only files 
with "jar" suffix that are created by the database engine in the sub 
directories and ignore the user created files with any other 
extensions in these directories.

I was hoping to find out some sure way to prevent users creating 
backup in the database directories, looks like there is not one 
without enforcing some special Security Permissions. Hopefully
with GRANT/REVOKE feature , an administrator of the database can
limit the users who can execute backup procedures.


Thanks
-surest

Jeffrey Lichtman wrote:
> I haven't been following this thread very closely, so please forgive me 
> if this has already been considered. I assume the problem is that the 
> backup algorithm creates a directory to contain the backup, so if the 
> location of the backup is in the database it tries to copy the contents 
> of the backup into itself.
> 
> Would it work to make a list of the contents of the database before 
> creating the backup directory, and then make the algorithm work off the 
> list? I suppose it would be better to keep the user from putting the 
> backup in the database, but that isn't always easy to prevent.
> 
> 
>                        -        Jeff Lichtman
>                                 swazoo@rcn.com
>                                 Check out Swazoo Koolak's Web Jukebox at
>                                 http://swazoo.com/
>