1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Add support for SQLITE_OPEN_NOFOLLOW.

FossilOrigin-Name: cb79c828496a703f1410f61458ebc1e15a92a63412b36f51945b2b5a32ec6e88
This commit is contained in:
drh
2019-11-18 17:46:38 +00:00
parent 804725a6b9
commit 0933aad72c
12 changed files with 97 additions and 25 deletions

View File

@@ -4788,6 +4788,14 @@ int sqlite3PagerOpen(
*/
if( zFilename && zFilename[0] ){
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;
}
}
nPathname = pVfs->mxPathname+1;
zPathname = sqlite3DbMallocRaw(0, nPathname*2);
if( zPathname==0 ){