[or-cvs] r15626: Fix for bug 742: do not use O_CREAT on 2-option version of o (in tor/trunk: . src/common)

nickm at seul.org nickm at seul.org
Thu Jul 3 15:04:18 UTC 2008


Author: nickm
Date: 2008-07-03 11:04:16 -0400 (Thu, 03 Jul 2008)
New Revision: 15626

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/common/util.c
Log:
 r16689 at tombo:  nickm | 2008-07-03 11:03:14 -0400
 Fix for bug 742: do not use O_CREAT on 2-option version of open().  Especially do not use it on /dev/null.  Fix from Michael Scherer. Bugfix on 0.0.2pre19 (wow).



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16689] on 49666b30-7950-49c5-bedf-9dc8f3168102

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-07-03 12:39:08 UTC (rev 15625)
+++ tor/trunk/ChangeLog	2008-07-03 15:04:16 UTC (rev 15626)
@@ -9,6 +9,9 @@
       "root:wheel". Fixes bug 676, reported by Serge Koksharov.
     - Fix macro collision between OpenSSL 0.9.8h and Windows headers.
       Fixes bug 704; fix from Steven Murdoch.
+    - When opening /dev/null in finish_daemonize(), do not pass the
+      O_CREAT flag.  Fortify was complaining, and correctly so.  Fixes
+      bug 742; fix from Michael Scherer.  Bugfix on 0.0.2pre19.
 
 
 Changes in version 0.2.1.2-alpha - 2008-06-20

Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2008-07-03 12:39:08 UTC (rev 15625)
+++ tor/trunk/src/common/util.c	2008-07-03 15:04:16 UTC (rev 15626)
@@ -3084,8 +3084,7 @@
     exit(1);
   }
 
-  nullfd = open("/dev/null",
-                O_CREAT | O_RDWR | O_APPEND);
+  nullfd = open("/dev/null", O_RDWR | O_APPEND);
   if (nullfd < 0) {
     log_err(LD_GENERAL,"/dev/null can't be opened. Exiting.");
     exit(1);



More information about the tor-commits mailing list