[or-cvs] r15627: Backport to 0.2.0: Fix for bug 742: do not use O_CREAT on 2- (in tor/branches/tor-0_2_0-patches: . src/common)

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


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

Modified:
   tor/branches/tor-0_2_0-patches/
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/common/util.c
Log:
 r16690 at tombo:  nickm | 2008-07-03 11:03:39 -0400
 Backport to 0.2.0: 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/branches/tor-0_2_0-patches
___________________________________________________________________
 svk:merge ticket from /tor/020 [r16690] on 49666b30-7950-49c5-bedf-9dc8f3168102

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-07-03 15:04:16 UTC (rev 15626)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-07-03 15:04:25 UTC (rev 15627)
@@ -30,6 +30,9 @@
       Fix for bug 707.
     - 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.0.28-rc - 2008-06-13

Modified: tor/branches/tor-0_2_0-patches/src/common/util.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/common/util.c	2008-07-03 15:04:16 UTC (rev 15626)
+++ tor/branches/tor-0_2_0-patches/src/common/util.c	2008-07-03 15:04:25 UTC (rev 15627)
@@ -3092,8 +3092,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