/ Check-in [fa8b80bb]
Login

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

Overview
Comment:In the os_unix.c implementation of xOpen(), do not return SQLITE_READONLY_DIRECTORY in cases where the file cannot be opened for reasons other than a readonly directory, such as the process running out of file descriptors.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:fa8b80bb967792de99808712ac03e37ace0f11eb8fbe444aacd3d19184c425ea
User & Date: dan 2018-01-09 20:34:53
Context
2018-01-09
20:44
Return SQLITE_CONSTRAINT if a user attempts to update a zipfile table. check-in: 64c9ccf6 user: dan tags: trunk
20:34
In the os_unix.c implementation of xOpen(), do not return SQLITE_READONLY_DIRECTORY in cases where the file cannot be opened for reasons other than a readonly directory, such as the process running out of file descriptors. check-in: fa8b80bb user: dan tags: trunk
18:31
Fix a potential crash in sqlite3expert.c caused by a missing sqlite3_reset() call. check-in: f6355970 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  5913   5913         isReadonly = 1;
  5914   5914         fd = robust_open(zName, openFlags, openMode);
  5915   5915       }
  5916   5916       if( fd<0 ){
  5917   5917         rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zName);
  5918   5918         /* If unable to create a journal, change the error code to
  5919   5919         ** indicate that the directory permissions are wrong. */
  5920         -      if( isNewJrnl && osAccess(zName, F_OK) ) rc = SQLITE_READONLY_DIRECTORY;
         5920  +      if( isNewJrnl && errno==EACCES && osAccess(zName, F_OK) ){
         5921  +        rc = SQLITE_READONLY_DIRECTORY;
         5922  +      }
  5921   5923         goto open_finished;
  5922   5924       }
  5923   5925   
  5924   5926       /* If this process is running as root and if creating a new rollback
  5925   5927       ** journal or WAL file, set the ownership of the journal or WAL to be
  5926   5928       ** the same as the original database.
  5927   5929       */