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

Change the temporary directory search algorithm on unix so that directories

with only -wx permission are allowed.  And do not allow "." to be returned if
it lacks -wx permission.

FossilOrigin-Name: 67985761aa93fb613b87d340e75371fa55b0f778
This commit is contained in:
drh
2016-04-21 23:37:24 +00:00
parent 83b74f29c5
commit 7694e06461
3 changed files with 13 additions and 12 deletions

View File

@@ -5420,10 +5420,10 @@ static const char *unixTempFileDir(void){
if( zDir==0 ) continue;
if( osStat(zDir, &buf) ) continue;
if( !S_ISDIR(buf.st_mode) ) continue;
if( osAccess(zDir, 07) ) continue;
break;
if( osAccess(zDir, 03) ) continue;
return zDir;
}
return zDir;
return 0;
}
/*
@@ -5439,9 +5439,11 @@ static int unixGetTempname(int nBuf, char *zBuf){
** using the io-error infrastructure to test that SQLite handles this
** function failing.
*/
zBuf[0] = 0;
SimulateIOError( return SQLITE_IOERR );
zDir = unixTempFileDir();
if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH;
do{
u64 r;
sqlite3_randomness(sizeof(r), &r);