Imported Upstream version 0.3.2
[anytun.git] / src / anytun.cpp
index 34fd5f5..de8429f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <boost/bind.hpp>
+#include <boost/thread.hpp>
+#include <boost/assign.hpp>
 #include <iostream>
 #include <fstream>
 
-
-#include <boost/bind.hpp>
-#include <cerrno>     // for ENOMEM
-
 #include "datatypes.h"
 
 #include "log.h"
@@ -76,7 +76,7 @@
 
 #include "cryptinit.hpp"
 #include "daemon.hpp"
-#include "sysexec.hpp"
+#include "sysExec.h"
 
 bool disableRouting = false;
 
@@ -327,7 +327,7 @@ void startSendRecvThreads(TunDevice* dev, PacketSource* src)
       do_chroot(gOpt.getChrootDir());
     }
     catch(const std::runtime_error& e) {
-      cLog.msg(Log::PRIO_WARNING) << "ignroing chroot error: " << e.what();
+      cLog.msg(Log::PRIO_WARNING) << "ignoring chroot error: " << e.what();
     }
   }
 #ifndef NO_PRIVDROP
@@ -445,7 +445,8 @@ int main(int argc, char* argv[])
 #ifndef NO_EXEC
     if(gOpt.getPostUpScript() != "") {
       cLog.msg(Log::PRIO_NOTICE) << "executing post-up script '" << gOpt.getPostUpScript() << "'";
-      execScript(gOpt.getPostUpScript(), dev.getActualName(), dev.getActualNode());
+      StringVector args = boost::assign::list_of(dev.getActualName())(dev.getActualNode());
+      anytun_exec(gOpt.getPostUpScript(), args);
     }
 #endif