Skip to content

Commit

Permalink
MFH: Fixed bug #27928 (sqlite incorrectly handles invalid filenames).
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Alshanetsky committed Apr 9, 2004
1 parent 230aea0 commit d478d17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/sqlite/libsqlite/src/os.c
Expand Up @@ -34,6 +34,9 @@
# ifndef O_BINARY
# define O_BINARY 0
# endif
# ifndef EISDIR
# define EISDIR 21
# endif
#endif


Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d478d17

Please sign in to comment.