mirror of
https://github.com/php/php-src.git
synced 2026-03-25 08:42:29 +01:00
MFH: Fixed bug #27928 (sqlite incorrectly handles invalid filenames).
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user