From: danielk1977 Date: Thu, 30 Aug 2007 16:13:33 +0000 (+0000) Subject: Prevent sqlite from opening directories as databases under unix. Fix for test cae... X-Git-Tag: version-3.6.10~1835 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f2d8c7331045ca53ab9cafc62c6df9f494b3334;p=thirdparty%2Fsqlite.git Prevent sqlite from opening directories as databases under unix. Fix for test cae in misc7.test. (CVS 4342) FossilOrigin-Name: e30546504c59c7d92d83a32d9b7e83edc175e247 --- diff --git a/manifest b/manifest index b23537e5ad..3008355ef5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Check\sin\sextra\sfixes\sfor\smalloc4.test.\s(CVS\s4341) -D 2007-08-30T15:46:07 +C Prevent\ssqlite\sfrom\sopening\sdirectories\sas\sdatabases\sunder\sunix.\sFix\sfor\stest\scae\sin\smisc7.test.\s(CVS\s4342) +D 2007-08-30T16:13:34 F Makefile.in bfcc303429a5d9dcd552d807ee016c77427418c3 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -116,7 +116,7 @@ F src/os_os2.c 8769301bff502de642ad2634cedcb77d967ce199 F src/os_os2.h c3f7d0af7e3453d1d7aa81b06c0a56f5a226530b F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 -F src/os_unix.c 0f3997dc16c4e83e1d5f4b392c30e1b20f0a77ba +F src/os_unix.c 84dcfc01006ae0b4f8e16cf094de4bdaf7ddf1a8 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c 3ffd3aacff4cb69848284e29dcec0feff23b0752 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b @@ -568,7 +568,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 23746924db3c005d1f75572c6cbb91db6fc41eb4 -R 80f8d106415c810b911e5727899048d8 +P 49ce3a838194f0316c883dbe1596d13c0c0fad1b +R b30cf53f87f8589eddcd76cb86e9eb93 U danielk1977 -Z d2507462ebb24d1bb162827dff859cd2 +Z f3d625c775127ec08c26228a50386eb4 diff --git a/manifest.uuid b/manifest.uuid index 0bd7b01f97..600e597135 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -49ce3a838194f0316c883dbe1596d13c0c0fad1b \ No newline at end of file +e30546504c59c7d92d83a32d9b7e83edc175e247 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index a1a0041e9b..c46d82407b 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2395,7 +2395,7 @@ static int unixOpen( memset(pFile, 0, sizeof(unixFile)); fd = open(zPath, oflags, isDelete?0600:SQLITE_DEFAULT_FILE_PERMISSIONS); - if( fd<0 && isReadWrite && !isExclusive ){ + if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){ /* Failed to open the file for read/write access. Try read-only. */ flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE); flags |= SQLITE_OPEN_READONLY;