~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

Viewing changes to src/port/dirmod.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-07-24 16:13:59 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140724161359-uk325qfv03euxuuh
Tags: 9.3.5-0ubuntu0.14.04.1
* New upstream bug fix release: (LP: #1348176)
  - pg_upgrade: Users who upgraded to version 9.3 using pg_upgrade may have
    an issue with transaction information which causes VACUUM to eventually
    fail. These users should run the script provided in the release notes to
    determine if their installation is affected, and then take the remedy
    steps outlined there.
  - Various data integrity and other bug fixes.
  - Secure Unix-domain sockets of temporary postmasters started during make
    check.
    Any local user able to access the socket file could connect as the
    server's bootstrap superuser, then proceed to execute arbitrary code as
    the operating-system user running the test, as we previously noted in
    CVE-2014-0067. This change defends against that risk by placing the
    server's socket in a temporary, mode 0700 subdirectory of /tmp.
  - See release notes for details:
    http://www.postgresql.org/about/news/1534/
* Remove pg_regress patches to support --host=/path, obsolete with above
  upstream changes and not applicable any more.
* Drop tcl8.6 patch, applied upstream.
* Add missing logrotate test dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
 
383
383
        filenames = (char **) palloc(fnsize * sizeof(char *));
384
384
 
385
 
        errno = 0;
386
 
        while ((file = readdir(dir)) != NULL)
 
385
        while (errno = 0, (file = readdir(dir)) != NULL)
387
386
        {
388
387
                if (strcmp(file->d_name, ".") != 0 && strcmp(file->d_name, "..") != 0)
389
388
                {
395
394
                        }
396
395
                        filenames[numnames++] = pstrdup(file->d_name);
397
396
                }
398
 
                errno = 0;
399
397
        }
 
398
 
400
399
#ifdef WIN32
401
 
 
402
 
        /*
403
 
         * This fix is in mingw cvs (runtime/mingwex/dirent.c rev 1.4), but not in
404
 
         * released version
405
 
         */
 
400
        /* Bug in old Mingw dirent.c;  fixed in mingw-runtime-3.2, 2003-10-10 */
406
401
        if (GetLastError() == ERROR_NO_MORE_FILES)
407
402
                errno = 0;
408
403
#endif
 
404
 
409
405
        if (errno)
410
406
        {
411
407
#ifndef FRONTEND
418
414
 
419
415
        filenames[numnames] = NULL;
420
416
 
421
 
        closedir(dir);
 
417
        if (closedir(dir))
 
418
        {
 
419
#ifndef FRONTEND
 
420
                elog(WARNING, "could not close directory \"%s\": %m", path);
 
421
#else
 
422
                fprintf(stderr, _("could not close directory \"%s\": %s\n"),
 
423
                                path, strerror(errno));
 
424
#endif
 
425
        }
422
426
 
423
427
        return filenames;
424
428
}