1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

In the SQLITE_OPEN_NOFOLLOW processing, distinguish between an I/O error

on the xAccess() call and an actual symlink encounter.

FossilOrigin-Name: 2e98b42fcb7bc38e22808a9dc1d7a4231ed08ffa97c9f08f33e6e8cd8726856c
This commit is contained in:
drh
2019-11-18 18:43:19 +00:00
parent 0933aad72c
commit 3c904885b1
3 changed files with 10 additions and 12 deletions

View File

@@ -4790,11 +4790,9 @@ int sqlite3PagerOpen(
const char *z;
if( (vfsFlags & SQLITE_OPEN_NOFOLLOW)!=0 ){
int isLink = 0;
if( sqlite3OsAccess(pVfs, zFilename, SQLITE_ACCESS_SYMLINK, &isLink)==0
&& isLink
){
return SQLITE_CANTOPEN_SYMLINK;
}
int rc = sqlite3OsAccess(pVfs, zFilename, SQLITE_ACCESS_SYMLINK, &isLink);
if( rc==SQLITE_OK && isLink ) rc = SQLITE_CANTOPEN_SYMLINK;
if( rc ) return rc;
}
nPathname = pVfs->mxPathname+1;
zPathname = sqlite3DbMallocRaw(0, nPathname*2);