]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 709169: check return from open("/dev/null", 0) and friends
authorHarlan Stenn <stenn@ntp.org>
Thu, 28 Jun 2012 06:28:32 +0000 (23:28 -0700)
committerHarlan Stenn <stenn@ntp.org>
Thu, 28 Jun 2012 06:28:32 +0000 (23:28 -0700)
bk: 4febf990yCArbG3UG0zzo-2Vxz9vbg

ChangeLog
ntpd/ntpd.c

index 104773ad42d790e83e70d856513dd214c2f34ace..c3979b0c3847cb040650313dc0178daab7ac149a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* CID 709169: check return from open("/dev/null", 0) and friends.
 (4.2.7p285) 2012/06/18 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2227] Enable mrulist access control via "restrict ... nomrulist".
 * Automake-1.12 wants us to use AM_PROG_AR.
index 589a0c6fcb2bfc793a390ef192cd294a712b8ac9..40e7d9cea3451704086035391df8f3f94d7a468a 100644 (file)
@@ -604,9 +604,8 @@ ntpdmain(
                        syslogit = TRUE;
                }
                close_all_except(waitsync_fd_to_close);
-               open("/dev/null", 0);
-               dup2(0, 1);
-               dup2(0, 2);
+               INSIST(0 == open("/dev/null", 0) && 1 == dup2(0, 1) \
+                       && 2 == dup2(0, 2));
 
                init_logging(progname, 0, TRUE);
                /* we lost our logfile (if any) daemonizing */