]> granicus.if.org Git - php/commitdiff
Fixed bug #27928 (sqlite incorrectly handles invalid filenames).
authorIlia Alshanetsky <iliaa@php.net>
Fri, 9 Apr 2004 18:02:05 +0000 (18:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 9 Apr 2004 18:02:05 +0000 (18:02 +0000)
NEWS
ext/sqlite/libsqlite/src/os.c

diff --git a/NEWS b/NEWS
index 657aa8ff2bdd518ffa8af79ba59ba4fb342ba2bb..c2a300d5dce1efa38f211dc4b50f0fa7cf786e17 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ PHP                                                                        NEWS
 - Changed SQLite extension to use studlyCaps convention in its OO API. (Marcus)
 - Changed __construct() to always take precedence over old style constructor.
   (Dmitry)
+- Fixed bug #27928 (sqlite incorrectly handles invalid filenames). (Ilia)
 - Fixed bug #27821 (xml_parse() segfaults when xml_set_object() is called from
   class method). (Andi, Rob)
 - Fixed bug #27742 (WDSL SOAP Parsing Schema bug). (Dmitry)
index 2c57078305bd32bc43b4ae6429daa744512babe3..12761bb2a326daeefaf54f957aac44b55e7c226a 100644 (file)
@@ -34,6 +34,9 @@
 # ifndef O_BINARY
 #  define O_BINARY 0
 # endif
+# ifndef EISDIR
+#  define EISDIR 21
+# endif
 #endif
 
 
@@ -464,6 +467,9 @@ int sqliteOsOpenReadWrite(
   id->dirfd = -1;
   id->fd = open(zFilename, O_RDWR|O_CREAT|O_LARGEFILE|O_BINARY, 0644);
   if( id->fd<0 ){
+    if (errno == EISDIR) {
+      return SQLITE_CANTOPEN;
+    }
     id->fd = open(zFilename, O_RDONLY|O_LARGEFILE|O_BINARY);
     if( id->fd<0 ){
       return SQLITE_CANTOPEN;