aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2007-08-30 16:13:33 +0000
committerdanielk1977 <danielk1977@noemail.net>2007-08-30 16:13:33 +0000
commit2f2d8c7331045ca53ab9cafc62c6df9f494b3334 (patch)
tree405e60ddf3632741d8b3cb80625abef63757ceb7 /src/os_unix.c
parentcd03724cb2fae0eba193f3871eb4351a3627f9c2 (diff)
downloadsqlite-2f2d8c7331045ca53ab9cafc62c6df9f494b3334.tar.gz
sqlite-2f2d8c7331045ca53ab9cafc62c6df9f494b3334.zip
Prevent sqlite from opening directories as databases under unix. Fix for test cae in misc7.test. (CVS 4342)
FossilOrigin-Name: e30546504c59c7d92d83a32d9b7e83edc175e247
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index a1a0041e9..c46d82407 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;