diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/Makefile | 1 | ||||
-rwxr-xr-x | src/configure | 26 | ||||
-rw-r--r-- | src/posix/sysExec.hpp | 20 | ||||
-rw-r--r-- | src/sysExec.h | 4 |
5 files changed, 29 insertions, 23 deletions
@@ -2,6 +2,7 @@ * Security fix: packet length check errors * fixed droping of priveleges on FreeBSD +* added sysExec for Windows * added multi socket support which allows simultanous usage of IPv4 and IPv6 even on operating systems without V4_MAPPED address support diff --git a/src/Makefile b/src/Makefile index 0e91563..6a3683d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -179,6 +179,7 @@ distclean: cleanall find . -name *.o -exec rm -f {} \; rm -f config.sub config.guess rm -f signalHandler.hpp + rm -f sysExec.hpp rm -f version.h rm -f tunDevice.cpp rm -f include.mk diff --git a/src/configure b/src/configure index 2c6d8ea..1524577 100755 --- a/src/configure +++ b/src/configure @@ -143,26 +143,30 @@ fi rm -f include.mk case $TARGET in - Linux) - rm -f tunDevice.cpp - ln -sf linux/tunDevice.cpp + Linux) + rm -f tunDevice.cpp + ln -sf linux/tunDevice.cpp rm -f signalHandler.hpp ln -sf posix/signalHandler.hpp + rm -f sysExec.hpp + ln -sf posix/sysExec.hpp echo "loading Linux specific TUN Device" - ;; - OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD) - rm -f tunDevice.cpp - ln -sf bsd/tunDevice.cpp + ;; + OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD) + rm -f tunDevice.cpp + ln -sf bsd/tunDevice.cpp rm -f signalHandler.hpp ln -sf posix/signalHandler.hpp + rm -f sysExec.hpp + ln -sf posix/sysExec.hpp echo "loading BSD specific TUN Device" CXXFLAGS=$CXXFLAGS' -I/usr/local/include' LDFLAGS=$LDFLAGS' -L/usr/local/lib' - ;; - *) - echo "platform not supported" + ;; + *) + echo "platform not supported" exit 1 - ;; + ;; esac case $CRYPTO_LIB in diff --git a/src/posix/sysExec.hpp b/src/posix/sysExec.hpp index 506e03d..359c1e4 100644 --- a/src/posix/sysExec.hpp +++ b/src/posix/sysExec.hpp @@ -29,10 +29,10 @@ * You should have received a copy of the GNU General Public License * along with anytun. If not, see <http://www.gnu.org/licenses/>. */ -#pragma once
-#ifndef ANYTUN_sysexec_hpp_INCLUDED
-#define ANYTUN_sysexec_hpp_INCLUDED
-
+#pragma once +#ifndef ANYTUN_sysexec_hpp_INCLUDED +#define ANYTUN_sysexec_hpp_INCLUDED + #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -42,7 +42,7 @@ #include <stdlib.h> #include <string.h> #include <cstring> -
+ SysExec::~SysExec() { if(!closed_) @@ -62,7 +62,7 @@ char** dupEnv(StringList const& env) evp[env.size()] = NULL; return evp; } -
+ void SysExec::doExec(std::string const& script, StringVector const& args, StringList const& env) { int pipefd[2]; @@ -145,7 +145,7 @@ int SysExec::waitForScript() return return_code_; } -
+ void SysExec::waitAndDestroy(SysExec*& s) { if(!s) @@ -161,6 +161,6 @@ void SysExec::waitAndDestroy(SysExec*& s) delete(s); s = NULL; -}
-
-#endif // ANYTUN_sysexec_hpp_INCLUDED
\ No newline at end of file +} + +#endif // ANYTUN_sysexec_hpp_INCLUDED diff --git a/src/sysExec.h b/src/sysExec.h index 28e6d23..02ac00e 100644 --- a/src/sysExec.h +++ b/src/sysExec.h @@ -60,7 +60,7 @@ class SysExec void doExec(std::string const& script, StringVector const& args, StringList const& env); std::string script_; - + bool closed_; #ifdef _MSC_VER PROCESS_INFORMATION process_info_; DWORD return_code_; @@ -69,7 +69,7 @@ class SysExec int pipefd_; int return_code_; #endif - bool closed_; + }; |