SQLite

Check-in [9b8fec60d8]
Login

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

Overview
Comment:Merge the temporary directory search algorithm fix from trunk.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tempfiles-25
Files: files | file ages | folders
SHA1: 9b8fec60d8e576cd09e1d075a59bfad1c6169d7a
User & Date: drh 2016-04-23 21:16:55.627
References
2016-04-29
20:30
Fix the temporary directory search algorithm for unix so that it fails gracefully even if all candidate directories are inaccessible. This fixes a bug that was introduced by check-in [9b8fec60d8e]. (check-in: 614bb709d3 user: drh tags: trunk)
Context
2016-04-25
15:03
Merge bug fix from trunk. (check-in: a905d5e08d user: drh tags: tempfiles-25)
2016-04-23
21:16
Merge the temporary directory search algorithm fix from trunk. (check-in: 9b8fec60d8 user: drh tags: tempfiles-25)
20:59
Fix the fix to the temporary directory search algorithm so that it continues to return "." as a fallback if that directory has the correct permissions. (check-in: b38fe522cf user: drh tags: trunk)
19:55
Merge the latest trunk changes. (check-in: 84da122dd6 user: drh tags: tempfiles-25)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/os_unix.c.
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
  };
  unsigned int i;
  struct stat buf;
  const char *zDir = sqlite3_temp_directory;

  if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR");
  if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR");
  for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); zDir=azDirs[i++]){
    if( zDir==0 ) continue;
    if( osStat(zDir, &buf) ) continue;
    if( !S_ISDIR(buf.st_mode) ) continue;
    if( osAccess(zDir, 03) ) continue;
    return zDir;
  }
  return 0;







|







5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
  };
  unsigned int i;
  struct stat buf;
  const char *zDir = sqlite3_temp_directory;

  if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR");
  if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR");
  for(i=0; i<=sizeof(azDirs)/sizeof(azDirs[0]); zDir=azDirs[i++]){
    if( zDir==0 ) continue;
    if( osStat(zDir, &buf) ) continue;
    if( !S_ISDIR(buf.st_mode) ) continue;
    if( osAccess(zDir, 03) ) continue;
    return zDir;
  }
  return 0;