summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-04-09 18:02:05 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-04-09 18:02:05 +0000
commit824f9a4d119779a6b47719d1f4d04450e2894fce (patch)
tree632fc2c707dd31216b459d1f212a7a4a0ba28d2b
parent7bedd9f8248b71bac2960a7b06d6c78e5605655f (diff)
downloadphp-git-824f9a4d119779a6b47719d1f4d04450e2894fce.tar.gz
Fixed bug #27928 (sqlite incorrectly handles invalid filenames).
-rw-r--r--NEWS1
-rw-r--r--ext/sqlite/libsqlite/src/os.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 657aa8ff2b..c2a300d5dc 100644
--- 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)
diff --git a/ext/sqlite/libsqlite/src/os.c b/ext/sqlite/libsqlite/src/os.c
index 2c57078305..12761bb2a3 100644
--- a/ext/sqlite/libsqlite/src/os.c
+++ b/ext/sqlite/libsqlite/src/os.c
@@ -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;