]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r16689@tombo: nickm | 2008-07-03 11:03:14 -0400
authorNick Mathewson <nickm@torproject.org>
Thu, 3 Jul 2008 15:04:16 +0000 (15:04 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 3 Jul 2008 15:04:16 +0000 (15:04 +0000)
 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).

svn:r15626

ChangeLog
src/common/util.c

index b7472e8950ccd39a256d3303285d7cabc73ced77..59320bbb5440fc6cb2ae72aab8a8165f3f89e152 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@ Changes in version 0.2.1.3-alpha - 2008-07-xx
       "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
index 17962fc7238c2c1efd731861bb63b461f0e0e484..47d6aecd8cef73d4fc8b5f799a95485c2e05dd93 100644 (file)
@@ -3084,8 +3084,7 @@ finish_daemon(const char *desired_cwd)
     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);