/ Check-in [180516bf]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bring the code that changes the owner of WAL and rollback files when running as root into alignment with trunk.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA3-256: 180516bf7bd5a61c11b1eef2c8c13ac63c7b00f821bb89393fc68d39852202de
User & Date: drh 2018-05-04 20:00:13
Context
2018-05-07
13:01
Merge enhancements from trunk, and especially the cell-overwrite optimization. check-in: cb3aa778 user: drh tags: apple-osx
2018-05-04
20:00
Bring the code that changes the owner of WAL and rollback files when running as root into alignment with trunk. check-in: 180516bf user: drh tags: apple-osx
19:33
Merge recent enhancements from trunk. check-in: e17bca2c user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  7142   7142         int rc2 = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zName);
  7143   7143         if( rc==SQLITE_OK ) rc = rc2;
  7144   7144         goto open_finished;
  7145   7145       }
  7146   7146   
  7147   7147       /* if we're opening the wal or journal and running as root, set the
  7148   7148       ** journal uid/gid */
  7149         -    if( !isReadonly && (flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL)) ){
  7150         -      uid_t euid = geteuid();
  7151         -      if( euid==0 && (euid!=uid || getegid()!=gid) ){
  7152         -        if( robustFchown(fd, uid, gid) ){
  7153         -          rc = SQLITE_CANTOPEN_BKPT;
  7154         -          goto open_finished;
  7155         -        }
  7156         -      }
         7149  +    if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){
         7150  +      robustFchown(fd, uid, gid);
  7157   7151       }
  7158   7152     }
  7159   7153     assert( fd>=0 );
  7160   7154     if( pOutFlags ){
  7161   7155       *pOutFlags = flags;
  7162   7156     }
  7163   7157