From: SourceForge.net <no...@so...> - 2005-12-29 13:17:27
|
Bugs item #623992, was opened at 2002-10-16 12:46 Message generated for change (Comment added) made by alexpeshkoff You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109028&aid=623992&group_id=9028 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Engine >Group: Fixed v2.0 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Henryk Paluch (paluch) Assigned to: Alexander Peshkov (alexpeshkoff) Summary: Double // in path might cause corruption - found _cause_ Initial Comment: Mixing database url might cause data lost. This behaviour was observed on this environment: * FirebirdSS-1.0.0.796-0 running on RedHat 7.3 * InterSolv ODBC client (+MS Access) has enterred path with double '//' like: 1.2.3.4://opt/interbase/data.gdb * Java client (using either firebirdsql or interclient) is using path with simple slash like: jdbc:firebirdsql:1.2.3.4/3050:/opt/interbase/data.gdb * Java is using autocommit as by default. Then following things happen: 1. Somebody opens ODBC connection (using // in path) 2. Java client is doing some insert/updates (autocommit) 3. These changes are visible by other java clients too, but not on ODBC connection. 4. ODBC connection is closed 5. All data changes made by java clients when that ODBC connection was done - HAD BEEN LOST. * The problem does NOT occure when ODBC path does not include two '//', for example (no other change): Database name: 1.2.3.4:/opt/interbase/data.gdb It seems that mixing these two path to database file might cause some strange things. Unfortunately the problem was reproduced on 1 of 2 databases only. Has anyone idea why this happen? (Maybe two different paths that point to same file might cause this problem?) ---------------------------------------------------------------------- >Comment By: Alexander Peshkov (alexpeshkoff) Date: 2005-12-29 16:16 Message: Logged In: YES user_id=423445 Module, extending file name, was rewritten in firebird 2.0 to avoid multiple buffer overflows. The issue is gone - one may add as many //// as wanted, extended file name anyway doesn't contain them. ---------------------------------------------------------------------- Comment By: Henryk Paluch (paluch) Date: 2002-11-08 14:07 Message: Logged In: YES user_id=630153 Hi folks! I made debug verson of firebird and traced super/jrd/whybk.c isc_attach_database () and ISC_expand_filename() and found, that ISC_expand_filename() did not remove leading double slash if the path does not contain symbolic links on the disk (if the path contains symbolic links, then leading slash is removed because of link expansion). Here is a brief summary (IP is changed, but path is real): DB URL: 1.2.3.4:/var/lib/interbase/strecl.gdb Breakpoint 1, isc_attach_database (user_status=0x409c569c, file_length=29, file_name=0x8260228 "/var/lib/interbase/strecl.gdb\016&\b\030 ", handle=0x409c56ec, dpb_length=55, (gdb) print expanded_filename $1 = "/var/lib/interbase/strecl.gdb\0..." Result: passed --------------------------------- DB URL: 1.2.3.4://var/lib/interbase/strecl.gdb Breakpoint 1, isc_attach_database (user_status=0x409c569c, file_length=30, file_name=0x82c40a0 "//var/lib/interbase/strecl.gdb", handle=0x409c56ec, dpb_length=55, (gdb) print expanded_filename $3 = "//var/lib/interbase/strecl.gdb\0... Result: failed ( leading // is not removed in expanded filename). ----------------------------------------- DB URL: 1.2.3.4:/var/lib/interbase//strecl.gdb Breakpoint 1, isc_attach_database (user_status=0x409c569c, file_length=30, file_name=0x82c40a0 "/var/lib/interbase//strecl.gdb", handle=0x409c56ec, (gdb) print expanded_filename $4 = "/var/lib/interbase/strecl.gdb\0 Result: passed. ----------------------------------------------------------------------------------- NOTE: The leading '//' does not mind if database file is on symlink path, for example: URL: 1.2.3.4: /opt/interbase/test1.gdb and the path is: /opt -> /usr/opt/interbase/test1.gdb Then even URL: 1.2.3.4://opt/interbase/test1.gdb is correctly expanded to: /usr/opt/interbase/test1.gdb Has somebody any comments? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109028&aid=623992&group_id=9028 |