SQLite

Check-in [880b5115]
Login

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

Overview
Comment:If the application-defined openDirectory() function returns SQLITE_CANTOPEN, then silently ignore the error. This allows the chromium sandbox to disallow opening of directories without causing errors.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 880b51150aaed804005f5062b4dd2fa0ffafa147
User & Date: drh 2011-08-23 20:11:32
Context
2011-08-23
23:41
Simplifications to the SQLITE_PAGECACHE_BLOCKALLOC logic. Reduce the number of difficult-to-reach branches. (check-in: d5d835fe user: drh tags: trunk)
20:11
If the application-defined openDirectory() function returns SQLITE_CANTOPEN, then silently ignore the error. This allows the chromium sandbox to disallow opening of directories without causing errors. (check-in: 880b5115 user: drh tags: trunk)
19:46
Change the way the "crash" VFS (test6.c) handles SQLITE_FCNTL_SIZE_HINT. (check-in: 40dd8a60 user: dan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

3346
3347
3348
3349
3350
3351
3352


3353
3354
3355
3356
3357
3358
3359
    int dirfd;
    OSTRACE(("DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n", pFile->zPath,
            HAVE_FULLFSYNC, isFullsync));
    rc = osOpenDirectory(pFile->zPath, &dirfd);
    if( rc==SQLITE_OK && dirfd>=0 ){
      full_fsync(dirfd, 0, 0);
      robust_close(pFile, dirfd, __LINE__);


    }
    pFile->ctrlFlags &= ~UNIXFILE_DIRSYNC;
  }
  return rc;
}

/*







>
>







3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
    int dirfd;
    OSTRACE(("DIRSYNC %s (have_fullfsync=%d fullsync=%d)\n", pFile->zPath,
            HAVE_FULLFSYNC, isFullsync));
    rc = osOpenDirectory(pFile->zPath, &dirfd);
    if( rc==SQLITE_OK && dirfd>=0 ){
      full_fsync(dirfd, 0, 0);
      robust_close(pFile, dirfd, __LINE__);
    }else if( rc==SQLITE_CANTOPEN ){
      rc = SQLITE_OK;
    }
    pFile->ctrlFlags &= ~UNIXFILE_DIRSYNC;
  }
  return rc;
}

/*
5177
5178
5179
5180
5181
5182
5183


5184
5185
5186
5187
5188
5189
5190
#else
      if( fsync(fd) )
#endif
      {
        rc = unixLogError(SQLITE_IOERR_DIR_FSYNC, "fsync", zPath);
      }
      robust_close(0, fd, __LINE__);


    }
  }
#endif
  return rc;
}

/*







>
>







5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
#else
      if( fsync(fd) )
#endif
      {
        rc = unixLogError(SQLITE_IOERR_DIR_FSYNC, "fsync", zPath);
      }
      robust_close(0, fd, __LINE__);
    }else if( rc==SQLITE_CANTOPEN ){
      rc = SQLITE_OK;
    }
  }
#endif
  return rc;
}

/*