]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed double fork bug.
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Mon, 17 Oct 2005 13:20:21 +0000 (13:20 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Mon, 17 Oct 2005 13:20:21 +0000 (13:20 +0000)
Pre-2.1_beta5

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@656 e7ae566f-a301-0410-adde-c780ea21d3b5

ChangeLog
configure.ac
init.c
openvpn.h

index 87d2f5b6cb8bbd44cd881bf8d9f8a4175d74b45f..cc763c99470267baabc0b7464e65eae8e89ccb70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@ Copyright (C) 2002-2005 OpenVPN Solutions LLC <info@openvpn.net>
 
 $Id$
 
+2005.10.xx -- Version 2.1-beta5
+
+* More PKCS#11 additions/changes (Alon Bar-Lev).
+
 2005.10.17 -- Version 2.1-beta4
 
 * Fixed bug introduced in 2.1-beta3 where management
index 1056887a8c8a8df72ac6d91329baa09ca9f2394f..7d9298b246448519e027f7af9dc7837fd32fe228 100644 (file)
@@ -25,7 +25,7 @@ dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.50)
 
-AC_INIT([OpenVPN], [2.1_beta4], [openvpn-users@lists.sourceforge.net], [openvpn])
+AC_INIT([OpenVPN], [2.1_beta5], [openvpn-users@lists.sourceforge.net], [openvpn])
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_SRCDIR(syshead.h)
 
diff --git a/init.c b/init.c
index 879c777321a0cacdbe585435f1bb8c15246f9717..c2fb6cfe5f03cb02a12256a6d439d42d5a5fd94b 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1860,7 +1860,7 @@ do_compute_occ_strings (struct context *c)
 static void
 do_init_first_time (struct context *c)
 {
-  if (c->first_time && !c->c2.did_we_daemonize)
+  if (c->first_time && !c->did_we_daemonize)
     {
       /* get user and/or group that we want to setuid/setgid to */
       c->c2.uid_gid_specified =
@@ -1871,10 +1871,10 @@ do_init_first_time (struct context *c)
       get_pid_file (c->options.writepid, &c->c2.pid_state);
 
       /* become a daemon if --daemon */
-      c->c2.did_we_daemonize = possibly_become_daemon (&c->options, c->first_time);
+      c->did_we_daemonize = possibly_become_daemon (&c->options, c->first_time);
 
       /* should we disable paging? */
-      if (c->options.mlock && c->c2.did_we_daemonize)
+      if (c->options.mlock && c->did_we_daemonize)
        do_mlockall (true);     /* call again in case we daemonized */
 
       /* save process ID in a file */
index 78bb67bf8f3a956141bbc34dba6d6dc506017aab..a8d4f5e2af313cbe33eaf56983a65b2b6159b84b 100644 (file)
--- a/openvpn.h
+++ b/openvpn.h
@@ -346,9 +346,6 @@ struct context_2
   struct user_state user_state;
   struct group_state group_state;
 
-  /* temporary variable */
-  bool did_we_daemonize;
-
   /* should we print R|W|r|w to console on packet transfers? */
   bool log_rw;
 
@@ -453,6 +450,9 @@ struct context
   struct plugin_list *plugins;
   bool plugins_owned;
   
+  /* set to true after we daemonize */
+  bool did_we_daemonize;
+
   /* level 1 context is preserved for
      SIGUSR1 restarts, but initialized
      for SIGHUP restarts */