diff options
author | drh <drh@noemail.net> | 2019-12-26 00:56:50 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-12-26 00:56:50 +0000 |
commit | 96e8eebf96fb2fe0f5ab91526fa6ea2b5486f559 (patch) | |
tree | 1a2cbf6d7b776eb0e45c1256b67e198ac24d12ab /src/os_unix.c | |
parent | 0b12613a006a69d05f4db3efd5c4190ef6a7bee9 (diff) | |
download | sqlite-96e8eebf96fb2fe0f5ab91526fa6ea2b5486f559.tar.gz sqlite-96e8eebf96fb2fe0f5ab91526fa6ea2b5486f559.zip |
In the xAccess() method of the unix VFS, return true if the named object
is a directory, regardless of what stat() reports as the st_size for the
object. Different filesystems report st_size differently for directories.
Problem reported on the mailing list by Stefan BrĂ¼ns.
FossilOrigin-Name: c8c6dd0e6582ec9103d007b294c42bb1820be1fa7dab85d873b04e0b90571626
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index 18f2afcb6..e6d58811c 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -6259,7 +6259,8 @@ static int unixAccess( if( flags==SQLITE_ACCESS_EXISTS ){ struct stat buf; - *pResOut = (0==osStat(zPath, &buf) && buf.st_size>0); + *pResOut = 0==osStat(zPath, &buf) && + (S_ISDIR(buf.st_mode) || buf.st_size>0); }else{ *pResOut = osAccess(zPath, W_OK|R_OK)==0; } |