pgsql: Don't pass an invalid file handle to dup2().

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't pass an invalid file handle to dup2().
Date: 2010-04-01 20:12:43
Message-ID: 20100401201243.1518F7541D0@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Don't pass an invalid file handle to dup2(). That causes a crash on
Windows, thanks to a feature in CRT called Parameter Validation.

Backpatch to 8.2, which is the oldest version supported on Windows. In
8.2 and 8.3 also backpatch the earlier change to use DEVNULL instead of
NULL_DEV #define for a /dev/null-like device. NULL_DEV was hard-coded to
"/dev/null" regardless of platform, which didn't work on Windows, while
DEVNULL works on all platforms. Restarting syslogger didn't work on
Windows on versions 8.3 and below because of that.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
pgsql/src/backend/postmaster:
postmaster.c (r1.505.2.7 -> r1.505.2.8)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c?r1=1.505.2.7&r2=1.505.2.8)
syslogger.c (r1.29.2.4 -> r1.29.2.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/syslogger.c?r1=1.29.2.4&r2=1.29.2.5)
pgsql/src/include:
c.h (r1.214.2.1 -> r1.214.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/c.h?r1=1.214.2.1&r2=1.214.2.2)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Meskes 2010-04-02 10:27:46 pgsql: FATAL errors are meant to stop ecpg immediately, e.g.
Previous Message Heikki Linnakangas 2010-04-01 20:12:34 pgsql: Don't pass an invalid file handle to dup2().