1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

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
This commit is contained in:
drh
2019-12-26 00:56:50 +00:00
parent 0b12613a00
commit 96e8eebf96
3 changed files with 9 additions and 8 deletions

View File

@@ -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;
}