SQLite

Check-in [b38fe522]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b38fe522cfc971b37ca04e7b63a92bbb6e0b01e1
User & Date: drh 2016-04-23 20:59:23
Context
2016-04-25
01:43
Fix a typo in the Makefile. (check-in: d0a579b3 user: mistachkin tags: trunk)
2016-04-23
21:16
Merge the temporary directory search algorithm fix from trunk. (check-in: 9b8fec60 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: b38fe522 user: drh tags: trunk)
2016-04-21
23:37
Change the temporary directory search algorithm on unix so that directories with only -wx permission are allowed. And do not allow "." to be returned if it lacks -wx permission. (check-in: 67985761 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs 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;