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

Test that the asynchronous backend works with components like "." or ".." in the path to the database file. (CVS 4403)

FossilOrigin-Name: 0a87a854226ccea920484613dd7f7873e673c96e
This commit is contained in:
danielk1977
2007-09-05 14:32:25 +00:00
parent df6a81c838
commit 7be2cce333
4 changed files with 92 additions and 14 deletions

View File

@@ -621,13 +621,18 @@ static int getFileLock(AsyncLock *pLock){
assert(eRequired>=0 && eRequired<=SQLITE_LOCK_EXCLUSIVE);
}
}
if( eRequired>pLock->eLock ){
rc = sqlite3OsLock(pLock->pFile, eRequired);
}else if(eRequired<pLock->eLock){
rc = sqlite3OsUnlock(pLock->pFile, eRequired);
if( rc==SQLITE_OK ){
pLock->eLock = eRequired;
}
}
if( rc==SQLITE_OK ){
pLock->eLock = eRequired;
else if( eRequired<pLock->eLock && eRequired<=SQLITE_LOCK_SHARED ){
rc = sqlite3OsUnlock(pLock->pFile, eRequired);
if( rc==SQLITE_OK ){
pLock->eLock = eRequired;
}
}
}
@@ -932,11 +937,11 @@ static int asyncFullPathname(
/* Replace any occurences of "<path-component>/../" with "" */
if( iOut>0 && iIn<=(nPathOut-4)
&& zPathOut[iIn]=='/' && zPathOut[iIn+1]=='.'
&& zPathOut[iIn+2]=='.' && zPathOut[iIn+2]=='/'
&& zPathOut[iIn+2]=='.' && zPathOut[iIn+3]=='/'
){
iIn += 3;
iOut--;
for( ; iOut>0 && zPathOut[iOut]!='/'; iOut--);
for( ; iOut>0 && zPathOut[iOut-1]!='/'; iOut--);
continue;
}