mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Do not attempt to set the permissions on an existing journal or wal file. Do this only immediately after creating a new file (or opening one zero bytes in size).
FossilOrigin-Name: 1d8086902ee96347491bce5ec04dc92ccd42efa1
This commit is contained in:
@@ -552,7 +552,10 @@ static int robust_open(const char *z, int f, mode_t m){
|
||||
if( fd>=0 ){
|
||||
if( m!=0 ){
|
||||
struct stat statbuf;
|
||||
if( osFstat(fd, &statbuf)==0 && (statbuf.st_mode&0777)!=m ){
|
||||
if( osFstat(fd, &statbuf)==0
|
||||
&& statbuf.st_size==0
|
||||
&& statbuf.st_mode&0777!=m
|
||||
){
|
||||
osFchmod(fd, m);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user