From ec2008e9e53b99ba1725d8398e21b9cb04f6b8ca Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Sat, 2 Jun 2012 15:45:11 +0200 Subject: bring openvpn in sync with openvpn git master and patches submitted to mailing list --- .hgignore | 37 +- openvpn/.gitignore | 4 +- openvpn/Makefile.am | 24 + .../build/msvc/msvc-generate/msvc-generate.vcxproj | 136 +-- openvpn/compat.m4 | 5 + openvpn/config-version.h.in | 1 + openvpn/configure.ac | 37 +- openvpn/distro/rpm/openvpn.spec.in | 45 +- openvpn/doc/openvpn.8 | 3 +- openvpn/openvpn.sln | 76 +- openvpn/src/compat/compat.vcxproj | 172 ++-- openvpn/src/compat/compat.vcxproj.filters | 82 +- openvpn/src/openvpn/console.c | 3 +- openvpn/src/openvpn/error.c | 66 +- openvpn/src/openvpn/event.c | 4 - openvpn/src/openvpn/init.c | 25 +- openvpn/src/openvpn/manage.c | 175 ++-- openvpn/src/openvpn/manage.h | 3 +- openvpn/src/openvpn/misc.c | 2 +- openvpn/src/openvpn/openvpn.vcxproj | 520 ++++++------ openvpn/src/openvpn/openvpn.vcxproj.filters | 914 ++++++++++----------- openvpn/src/openvpn/options.c | 48 +- openvpn/src/openvpn/options.h | 5 +- openvpn/src/openvpn/socket.c | 10 +- openvpn/src/openvpn/syshead.h | 1 + openvpn/src/openvpn/tun.c | 4 +- openvpn/src/openvpn/tun.h | 3 - openvpn/src/openvpnserv/openvpnserv.vcxproj | 222 ++--- .../src/openvpnserv/openvpnserv.vcxproj.filters | 68 +- openvpn/tests/Makefile.am | 5 +- openvpn/tests/t_client.sh.in | 15 +- src/de/blinkt/openvpn/VpnProfile.java | 3 +- 32 files changed, 1398 insertions(+), 1320 deletions(-) create mode 100644 openvpn/config-version.h.in diff --git a/.hgignore b/.hgignore index 9000d970..4240f434 100644 --- a/.hgignore +++ b/.hgignore @@ -8,6 +8,41 @@ openvpn/aclocal.m4 openvpn/config.log openvpn/config.h.in openvpn/configure + syntax: regexp .DS_Store -^openvpn/xcopenvpn$ \ No newline at end of file +^openvpn/xcopenvpn$ + +syntax: glob +openvpn/src/openvpnserv/.deps +openvpn/Makefile +openvpn/Makefile.in +openvpn/build/Makefile +openvpn/build/Makefile.in +openvpn/build/msvc/Makefile +openvpn/build/msvc/Makefile.in +openvpn/src/openvpn/.deps +openvpn/src/compat/.deps +*.o + +*.patch +openvpn/distro/Makefile.in +openvpn/distro/rpm/Makefile.in +openvpn/doc/Makefile.in +openvpn/include/Makefile.in +depcomp +openvpn/config.guess +openvpn/config.sub +openvpn/install-sh +openvpn/ltmain.sh +openvpn/m4/libtool.m4 +openvpn/m4/ltoptions.m4 +openvpn/m4/ltsugar.m4 +openvpn/m4/ltversion.m4 +openvpn/m4/lt~obsolete.m4 +openvpn/missing +openvpn/sample/Makefile.in +openvpn/src/Makefile.in +openvpn/src/compat/Makefile.in +openvpn/src/openvpnserv/Makefile.in +openvpn/tests/Makefile.in \ No newline at end of file diff --git a/openvpn/.gitignore b/openvpn/.gitignore index 324accf7..f762089d 100644 --- a/openvpn/.gitignore +++ b/openvpn/.gitignore @@ -1,4 +1,5 @@ *.[oa] +*.l[oa] *.dll *.exe *.exe.* @@ -17,6 +18,7 @@ Release Debug Win32-Output .deps +.libs Makefile Makefile.in aclocal.m4 @@ -49,4 +51,4 @@ doc/openvpn.8.html distro/rpm/openvpn.spec tests/t_client.sh src/openvpn/openvpn -xcopenvpn +config-version.h diff --git a/openvpn/Makefile.am b/openvpn/Makefile.am index ab3e3d2e..c5805797 100644 --- a/openvpn/Makefile.am +++ b/openvpn/Makefile.am @@ -40,19 +40,33 @@ MAINTAINERCLEANFILES = \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 \ $(srcdir)/config.guess $(srcdir)/config.sub +CLEANFILES = \ + config-version.h + EXTRA_DIST = \ contrib \ debug +.PHONY: config-version.h + +if GIT_CHECKOUT +BUILT_SOURCES = \ + config-version.h +endif + SUBDIRS = build distro include src sample doc tests dist_doc_DATA = \ + README \ + README.IPv6 \ + README.polarssl \ COPYRIGHT.GPL \ COPYING dist_noinst_DATA = \ .gitignore \ .gitattributes \ + config-version.h.in \ PORTS \ README.IPv6 TODO.IPv6 \ README.polarssl \ @@ -75,3 +89,13 @@ if WIN32 rootdir=$(prefix) root_DATA = version.sh endif + +config-version.h: + @CONFIGURE_GIT_REVISION="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --symbolic-full-name HEAD`/`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --short=16 HEAD`"; \ + $(SED) "s#@CONFIGURE_GIT_REVISION[@]#$${CONFIGURE_GIT_REVISION}#g" "$(srcdir)/config-version.h.in" > config-version.h.tmp + @if ! [ -f config-version.h ] || ! cmp -s config-version.h.tmp config-version.h; then \ + echo "replacing config-version.h"; \ + mv config-version.h.tmp config-version.h; \ + else \ + rm -f config-version.h.tmp; \ + fi diff --git a/openvpn/build/msvc/msvc-generate/msvc-generate.vcxproj b/openvpn/build/msvc/msvc-generate/msvc-generate.vcxproj index 8b7ec220..e6491aba 100644 --- a/openvpn/build/msvc/msvc-generate/msvc-generate.vcxproj +++ b/openvpn/build/msvc/msvc-generate/msvc-generate.vcxproj @@ -1,69 +1,69 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {8598C2C8-34C4-47A1-99B0-7C295A890615} - msvc-generate - MakeFileProj - - - - Makefile - - - Makefile - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - nmake -f Makefile.mak all - nmake -f Makefile.mak clean all - nmake -f Makefile.mak clean - config-msvc-version.h - WIN32;_DEBUG;$(NMakePreprocessorDefinitions) - $(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - $(Configuration)\ - $(Configuration)\ - nmake -f Makefile.mak all - nmake -f Makefile.mak clean all - nmake -f Makefile.mak clean - config-msvc-version.h - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - $(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {8598C2C8-34C4-47A1-99B0-7C295A890615} + msvc-generate + MakeFileProj + + + + Makefile + + + Makefile + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Configuration)\ + $(Configuration)\ + nmake -f Makefile.mak all + nmake -f Makefile.mak clean all + nmake -f Makefile.mak clean + config-msvc-version.h + WIN32;_DEBUG;$(NMakePreprocessorDefinitions) + $(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + $(Configuration)\ + $(Configuration)\ + nmake -f Makefile.mak all + nmake -f Makefile.mak clean all + nmake -f Makefile.mak clean + config-msvc-version.h + WIN32;NDEBUG;$(NMakePreprocessorDefinitions) + $(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + + + + + + + + + + \ No newline at end of file diff --git a/openvpn/compat.m4 b/openvpn/compat.m4 index d5c01f76..4c132544 100644 --- a/openvpn/compat.m4 +++ b/openvpn/compat.m4 @@ -42,6 +42,11 @@ ifdef( , [AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], [GNU_SOURCE])] ) +ifdef( + [AC_PROG_SED], + , + [AC_DEFUN([AC_PROG_SED], [AC_CHECK_PROGS([SED], [sed])])] +) ifdef( [AC_TYPE_INT8_T], , diff --git a/openvpn/config-version.h.in b/openvpn/config-version.h.in new file mode 100644 index 00000000..27ee36af --- /dev/null +++ b/openvpn/config-version.h.in @@ -0,0 +1 @@ +#define CONFIGURE_GIT_REVISION "@CONFIGURE_GIT_REVISION@" diff --git a/openvpn/configure.ac b/openvpn/configure.ac index 399b4e78..913ace63 100644 --- a/openvpn/configure.ac +++ b/openvpn/configure.ac @@ -252,7 +252,7 @@ AC_ARG_WITH( [with_crypto_library="openssl"] ) -AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${host}", [A string representing our host]) +AC_DEFINE_UNQUOTED([TARGET_ALIAS], ["${host}"], [A string representing our host]) case "$host" in *-*-linux*) AC_DEFINE([TARGET_LINUX], [1], [Are we running on Linux?]) @@ -300,6 +300,7 @@ PKG_PROG_PKG_CONFIG AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S +AC_PROG_SED AC_PROG_MAKE_SET AC_ARG_VAR([IFCONFIG], [full path to ipconfig utility]) @@ -307,11 +308,13 @@ AC_ARG_VAR([ROUTE], [full path to route utility]) AC_ARG_VAR([IPROUTE], [full path to ip utility]) AC_ARG_VAR([NETSTAT], [path to netstat utility]) # tests AC_ARG_VAR([MAN2HTML], [path to man2html utility]) +AC_ARG_VAR([GIT], [path to git utility]) AC_PATH_PROGS([IFCONFIG], [ifconfig],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin]) AC_PATH_PROGS([ROUTE], [route],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin]) AC_PATH_PROGS([IPROUTE], [ip],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin]) AC_CHECK_PROGS([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc]) # tests AC_CHECK_PROGS([MAN2HTML], [man2html]) +AC_CHECK_PROGS([GIT], [git]) # optional AC_DEFINE_UNQUOTED([IFCONFIG_PATH], ["$IFCONFIG"], [Path to ifconfig tool]) AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool]) AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool]) @@ -365,7 +368,7 @@ AC_CHECK_HEADERS([ \ ]) AC_CHECK_HEADERS([ \ sys/time.h sys/ioctl.h sys/stat.h \ - sys/mman.h sys/file.h \ + sys/mman.h sys/file.h sys/wait.h \ unistd.h signal.h libgen.h stropts.h \ syslog.h pwd.h grp.h \ sys/sockio.h sys/uio.h linux/sockios.h \ @@ -734,6 +737,27 @@ if test -z "${POLARSSL_LIBS}"; then ) fi +if test "${with_crypto_library}" = "polarssl" ; then + AC_MSG_CHECKING([polarssl version]) + old_CFLAGS="${CFLAGS}" + CFLAGS="${POLARSSL_CFLAGS} ${CFLAGS}" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include + ]], + [[ +#if POLARSSL_VERSION_NUMBER <= 0x01010000 +#error invalid version +#endif + ]] + )], + [AC_MSG_RESULT([ok])], + [AC_MSG_ERROR([invalid polarssl version])] + ) + CFLAGS="${old_CFLAGS}" +fi + AC_ARG_VAR([LZO_CFLAGS], [C compiler flags for lzo]) AC_ARG_VAR([LZO_LIBS], [linker flags for lzo]) have_lzo="yes" @@ -781,6 +805,14 @@ PKG_CHECK_MODULES( [] ) +AC_MSG_CHECKING([git checkout]) +GIT_CHECKOUT="no" +if test -n "${GIT}" -a -d "${srcdir}/.git"; then + AC_DEFINE([HAVE_CONFIG_VERSION_H], [1], [extra version available in config-version.h]) + GIT_CHECKOUT="yes" +fi +AC_MSG_RESULT([${GIT_CHECKOUT}]) + if test -n "${SP_PLATFORM_WINDOWS}"; then AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ['\\\\'], [Path separator]) #" AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], ["\\\\"], [Path separator]) #" @@ -928,6 +960,7 @@ AC_SUBST([OPTIONAL_PKCS11_HELPER_CFLAGS]) AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS]) AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) +AM_CONDITIONAL([GIT_CHECKOUT], [test "${GIT_CHECKOUT}" = "yes"]) sampledir="\$(docdir)/sample" AC_SUBST([sampledir]) diff --git a/openvpn/distro/rpm/openvpn.spec.in b/openvpn/distro/rpm/openvpn.spec.in index d9158c15..3c316bfb 100644 --- a/openvpn/distro/rpm/openvpn.spec.in +++ b/openvpn/distro/rpm/openvpn.spec.in @@ -12,8 +12,8 @@ # rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1' Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan. -Name: @PACKAGE@ -Version: @VERSION@ +Name: @PACKAGE@ +Version: @VERSION@ Release: 1 URL: http://openvpn.net/ Source0: http://prdownloads.sourceforge.net/openvpn/%{name}-%{version}.tar.gz @@ -30,27 +30,27 @@ BuildRoot: %{_tmppath}/%{name}-%(id -un) AutoReq: 0 -BuildRequires: openssl-devel >= 0.9.6 -Requires: openssl >= 0.9.6 +BuildRequires: openssl-devel >= 0.9.7 +Requires: openssl >= 0.9.7 %if "%{_vendor}" == "Mandrakesoft" -%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07} -%{!?without_lzo:Requires: liblzo1 >= 1.07} +%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07} +%{!?without_lzo:Requires: liblzo1 >= 1.07} %else %if "%{_vendor}" == "MandrakeSoft" -%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07} -%{!?without_lzo:Requires: liblzo1 >= 1.07} +%{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07} +%{!?without_lzo:Requires: liblzo1 >= 1.07} %else -%{!?without_lzo:BuildRequires: lzo-devel >= 1.07} -%{!?without_lzo:Requires: lzo >= 1.07} +%{!?without_lzo:BuildRequires: lzo-devel >= 1.07} +%{!?without_lzo:Requires: lzo >= 1.07} %endif %endif -%{!?without_pam:BuildRequires: pam-devel} -%{!?without_pam:Requires: pam} +%{!?without_pam:BuildRequires: pam-devel} +%{!?without_pam:Requires: pam} -%{?with_pkcs11:BuildRequires: pkcs11-helper-devel} -%{?with_pkcs11:Requires: pkcs11-helper} +%{?with_pkcs11:BuildRequires: pkcs11-helper-devel} +%{?with_pkcs11:Requires: pkcs11-helper} # # Description @@ -68,7 +68,7 @@ and portability to most major OS platforms. %package devel Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan. Group: Applications/Internet -Requires: %{name} +Requires: %{name} %description devel Development support for OpenVPN. @@ -134,10 +134,10 @@ popd # Install init script %if "%{VENDOR}" == "SuSE" %__install -c -d -m 755 "%{buildroot}/etc/init.d" -%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}" +%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}" %else %__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d" -%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}" +%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}" %endif # Install /etc/openvpn @@ -164,6 +164,10 @@ done %__mv -f src/plugins/README src/plugins/README.plugins +# Install extra %doc stuff +cp -r AUTHORS ChangeLog NEWS contrib/ sample/ src/plugins/README.* \ + "%{buildroot}/%{_docdir}/%{name}-%{version}" + # # Clean section # @@ -207,13 +211,15 @@ fi # # Files section # +# don't use %doc as old rpmbuild removes it[1]. +# [1] http://rpm.org/ticket/836 %files %defattr(-,root,root) -%doc AUTHORS ChangeLog COPYING COPYRIGHT.GPL INSTALL NEWS PORTS README %{_mandir} %{_sbindir}/%{name} %{_datadir}/%{name} +%{_docdir}/%{name}-%{version} %dir /etc/%{name} %if "%{VENDOR}" == "SuSE" /etc/init.d/%{name} @@ -221,9 +227,6 @@ fi /etc/rc.d/init.d/%{name} %endif -# Install extra %doc stuff -%doc contrib/ sample/ src/plugins/README.* - %files devel %defattr(-,root,root) %{_includedir}/* diff --git a/openvpn/doc/openvpn.8 b/openvpn/doc/openvpn.8 index 24b1a2c4..f420d584 100644 --- a/openvpn/doc/openvpn.8 +++ b/openvpn/doc/openvpn.8 @@ -1087,7 +1087,8 @@ When used with .B \-\-client or .B \-\-pull, -accept options pushed by server EXCEPT for routes. +accept options pushed by server EXCEPT for routes and dhcp options +like DNS servers. When used on the client, this option effectively bars the server from adding routes to the client's routing table, diff --git a/openvpn/openvpn.sln b/openvpn/openvpn.sln index 90c01b89..f832e7a4 100644 --- a/openvpn/openvpn.sln +++ b/openvpn/openvpn.sln @@ -1,38 +1,38 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcxproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcxproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-generate", "build\msvc\msvc-generate\msvc-generate.vcxproj", "{8598C2C8-34C4-47A1-99B0-7C295A890615}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat", "src\compat\compat.vcxproj", "{4B2E2719-E661-45D7-9203-F6F456B22F19}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32 - {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32 - {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32 - {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32 - {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32 - {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32 - {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32 - {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32 - {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32 - {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32 - {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32 - {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32 - {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32 - {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32 - {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32 - {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcxproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcxproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-generate", "build\msvc\msvc-generate\msvc-generate.vcxproj", "{8598C2C8-34C4-47A1-99B0-7C295A890615}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compat", "src\compat\compat.vcxproj", "{4B2E2719-E661-45D7-9203-F6F456B22F19}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/openvpn/src/compat/compat.vcxproj b/openvpn/src/compat/compat.vcxproj index 42979c11..d872fa75 100644 --- a/openvpn/src/compat/compat.vcxproj +++ b/openvpn/src/compat/compat.vcxproj @@ -1,87 +1,87 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {4B2E2719-E661-45D7-9203-F6F456B22F19} - compat - Win32Proj - - - - StaticLibrary - MultiByte - true - - - StaticLibrary - MultiByte - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Platform)-Output\$(Configuration)\ - $(Configuration)\ - $(SolutionDir)$(Platform)-Output\$(Configuration)\ - $(Configuration)\ - - - - Disabled - $(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - - - MaxSpeed - true - $(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {4B2E2719-E661-45D7-9203-F6F456B22F19} + compat + Win32Proj + + + + StaticLibrary + MultiByte + true + + + StaticLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(Configuration)\ + $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(Configuration)\ + + + + Disabled + $(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + + + MaxSpeed + true + $(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/openvpn/src/compat/compat.vcxproj.filters b/openvpn/src/compat/compat.vcxproj.filters index 00bb0ffa..9576c512 100644 --- a/openvpn/src/compat/compat.vcxproj.filters +++ b/openvpn/src/compat/compat.vcxproj.filters @@ -1,42 +1,42 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + \ No newline at end of file diff --git a/openvpn/src/openvpn/console.c b/openvpn/src/openvpn/console.c index 35372df7..afda8ca3 100644 --- a/openvpn/src/openvpn/console.c +++ b/openvpn/src/openvpn/console.c @@ -232,8 +232,7 @@ get_console_input (const char *prompt, const bool echo, char *input, const int c } } #else - msg (M_ERR, "Requiring input from console: %s", prompt); - msg (M_FATAL, "Sorry, but I can't get console input on this OS"); + msg (M_FATAL, "Sorry, but I can't get console input on this OS (%s)", prompt); #endif return ret; } diff --git a/openvpn/src/openvpn/error.c b/openvpn/src/openvpn/error.c index e2e24b1e..d6ad6393 100644 --- a/openvpn/src/openvpn/error.c +++ b/openvpn/src/openvpn/error.c @@ -308,46 +308,46 @@ void x_msg (const unsigned int flags, const char *format, ...) prefix, prefix_sep, m1); - virtual_output_print (vo, flags, m2); + virtual_output_print (vo, flags, m2); } } - if (!(flags & M_MSG_VIRT_OUT) ) + if (!(flags & M_MSG_VIRT_OUT)) { - if (use_syslog && !std_redir && !forked) - { + if (use_syslog && !std_redir && !forked) + { #if SYSLOG_CAPABILITY - syslog (level, "%s%s%s", - prefix, - prefix_sep, - m1); + syslog (level, "%s%s%s", + prefix, + prefix_sep, + m1); #endif - } + } else - { - FILE *fp = msg_fp(flags); - const bool show_usec = check_debug_level (DEBUG_LEVEL_USEC_TIME); - - if ((flags & M_NOPREFIX) || suppress_timestamps) - { - fprintf (fp, "%s%s%s%s", - prefix, - prefix_sep, - m1, - (flags&M_NOLF) ? "" : "\n"); - } - else - { - fprintf (fp, "%s %s%s%s%s", - time_string (0, 0, show_usec, &gc), - prefix, - prefix_sep, - m1, - (flags&M_NOLF) ? "" : "\n"); - } - fflush(fp); - ++x_msg_line_num; - } + { + FILE *fp = msg_fp(flags); + const bool show_usec = check_debug_level (DEBUG_LEVEL_USEC_TIME); + + if ((flags & M_NOPREFIX) || suppress_timestamps) + { + fprintf (fp, "%s%s%s%s", + prefix, + prefix_sep, + m1, + (flags&M_NOLF) ? "" : "\n"); + } + else + { + fprintf (fp, "%s %s%s%s%s", + time_string (0, 0, show_usec, &gc), + prefix, + prefix_sep, + m1, + (flags&M_NOLF) ? "" : "\n"); + } + fflush(fp); + ++x_msg_line_num; + } } if (flags & M_FATAL) diff --git a/openvpn/src/openvpn/event.c b/openvpn/src/openvpn/event.c index 0463d985..2a13e1cf 100644 --- a/openvpn/src/openvpn/event.c +++ b/openvpn/src/openvpn/event.c @@ -753,10 +753,6 @@ po_wait (struct event_set *es, const struct timeval *tv, struct event_set_return ++out; ++j; } - else if(pfdp->revents==0x0020) - { - openvpn_exit (OPENVPN_EXIT_STATUS_ERROR); - } else if (pfdp->revents) { msg (D_EVENT_ERRORS, "Error: poll: unknown revents=0x%04x", (unsigned int)pfdp->revents); diff --git a/openvpn/src/openvpn/init.c b/openvpn/src/openvpn/init.c index 810a0c6f..a25de5d2 100644 --- a/openvpn/src/openvpn/init.c +++ b/openvpn/src/openvpn/init.c @@ -1477,13 +1477,13 @@ do_open_tun (struct context *c) &gc); do_ifconfig (c->c1.tuntap, guess, TUN_MTU_SIZE (&c->c2.frame), c->c2.es); } - - /* possibly add routes */ - if(ifconfig_order() == ROUTE_BEFORE_TUN) { - // Ignore route_delay - do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list, - c->c1.tuntap, c->plugins, c->c2.es); - } + + /* possibly add routes */ + if(ifconfig_order() == ROUTE_BEFORE_TUN) { + /* Ignore route_delay, would cause ROUTE_BEFORE_TUN to be ignored */ + do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list, + c->c1.tuntap, c->plugins, c->c2.es); + } /* open the tun device */ open_tun (c->options.dev, c->options.dev_type, c->options.dev_node, @@ -1516,11 +1516,10 @@ do_open_tun (struct context *c) c->c2.es); /* possibly add routes */ - if(ifconfig_order() == ROUTE_AFTER_TUN) { - if (!c->options.route_delay_defined) + if ((ifconfig_order() == ROUTE_AFTER_TUN) && (!c->options.route_delay_defined)) do_route (&c->options, c->c1.route_list, c->c1.route_ipv6_list, c->c1.tuntap, c->plugins, c->c2.es); - } + /* * Did tun/tap driver give us an MTU? */ @@ -1724,9 +1723,8 @@ do_up (struct context *c, bool pulled_options, unsigned int option_types_found) save_pulled_options_digest (c, &c->c2.pulled_options_digest); #endif -#ifndef ROUTE_BEFORE_TUN /* if --route-delay was specified, start timer */ - if (c->options.route_delay_defined) + if ((ifconfig_order() == ROUTE_AFTER_TUN) && c->options.route_delay_defined) { event_timeout_init (&c->c2.route_wakeup, c->options.route_delay, now); event_timeout_init (&c->c2.route_wakeup_expire, c->options.route_delay + c->options.route_delay_window, now); @@ -1734,7 +1732,6 @@ do_up (struct context *c, bool pulled_options, unsigned int option_types_found) tun_standby_init (c->c1.tuntap); } else -#endif { initialization_sequence_completed (c, 0); /* client/p2p --route-delay undefined */ } @@ -2292,10 +2289,10 @@ do_init_crypto_tls (struct context *c, const unsigned int flags) to.mda_context = &c->c2.mda_context; #endif - to.tmp_dir = options->tmp_dir; #if P2MP_SERVER to.auth_user_pass_verify_script = options->auth_user_pass_verify_script; to.auth_user_pass_verify_script_via_file = options->auth_user_pass_verify_script_via_file; + to.tmp_dir = options->tmp_dir; if (options->ccd_exclusive) to.client_config_dir_exclusive = options->client_config_dir; #endif diff --git a/openvpn/src/openvpn/manage.c b/openvpn/src/openvpn/manage.c index f7ca8e15..cc22208e 100644 --- a/openvpn/src/openvpn/manage.c +++ b/openvpn/src/openvpn/manage.c @@ -58,9 +58,6 @@ #define MANAGEMENT_ECHO_FLAGS 0 #endif -#include - - /* tag for blank username/password */ static const char blank_up[] = "[[BLANK]]"; @@ -69,9 +66,6 @@ struct management *management; /* GLOBAL */ /* static forward declarations */ static void man_output_standalone (struct management *man, volatile int *signal_received); static void man_reset_client_socket (struct management *man, const bool exiting); -static ssize_t write_fd (int fd, void *ptr, size_t nbytes, int flags, int sendfd); -static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int flags, int *recvfd); - static void man_help () @@ -1811,6 +1805,78 @@ man_io_error (struct management *man, const char *prefix) return false; } +#ifdef TARGET_ANDROID +static ssize_t write_fd (int fd, void *ptr, size_t nbytes, int flags, int sendfd) +{ + struct msghdr msg; + struct iovec iov[1]; + + union { + struct cmsghdr cm; + char control[CMSG_SPACE(sizeof(int))]; + } control_un; + struct cmsghdr *cmptr; + + msg.msg_control = control_un.control; + msg.msg_controllen = sizeof(control_un.control); + + cmptr = CMSG_FIRSTHDR(&msg); + cmptr->cmsg_len = CMSG_LEN(sizeof(int)); + cmptr->cmsg_level = SOL_SOCKET; + cmptr->cmsg_type = SCM_RIGHTS; + *((int *) CMSG_DATA(cmptr)) = sendfd; + + msg.msg_name = NULL; + msg.msg_namelen = 0; + + iov[0].iov_base = ptr; + iov[0].iov_len = nbytes; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + + return (sendmsg(fd, &msg, flags)); +} + +static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int flags, int *recvfd) +{ + struct msghdr msghdr; + struct iovec iov[1]; + ssize_t n; + + union { + struct cmsghdr cm; + char control[CMSG_SPACE(sizeof (int))]; + } control_un; + struct cmsghdr *cmptr; + + msghdr.msg_control = control_un.control; + msghdr.msg_controllen = sizeof(control_un.control); + + msghdr.msg_name = NULL; + msghdr.msg_namelen = 0; + + iov[0].iov_base = ptr; + iov[0].iov_len = nbytes; + msghdr.msg_iov = iov; + msghdr.msg_iovlen = 1; + + if ( (n = recvmsg(fd, &msghdr, flags)) <= 0) + return (n); + + if ( (cmptr = CMSG_FIRSTHDR(&msghdr)) != NULL && + cmptr->cmsg_len == CMSG_LEN(sizeof(int))) { + if (cmptr->cmsg_level != SOL_SOCKET) + msg (M_ERR, "control level != SOL_SOCKET"); + if (cmptr->cmsg_type != SCM_RIGHTS) + msg (M_ERR, "control type != SCM_RIGHTS"); + *recvfd = *((int *) CMSG_DATA(cmptr)); + } else + *recvfd = -1; /* descriptor was not passed */ + + return (n); +} +#endif + static int man_read (struct management *man) @@ -1820,19 +1886,16 @@ man_read (struct management *man) */ unsigned char buf[256]; int len = 0; - int fd = -1; #ifdef TARGET_ANDROID - len = read_fd (man->connection.sd_cli, buf, sizeof (buf), MSG_NOSIGNAL, &fd); - __android_log_print(ANDROID_LOG_DEBUG,"openvpn-dbg","read_fd %d %d", len, fd); - if(fd >= 0) { - man->connection.lastfdreceived = fd; - if(len == 0) // No data message but a fd, return without resetting socket... - return 0; - } + int fd; + len = read_fd (man->connection.sd_cli, buf, sizeof (buf), MSG_NOSIGNAL, &fd); + if(fd >= 0) + man->connection.lastfdreceived = fd; #else - len = recv (man->connection.sd_cli, buf, sizeof (buf), MSG_NOSIGNAL); + len = recv (man->connection.sd_cli, buf, sizeof (buf), MSG_NOSIGNAL); #endif + if (len == 0) { man_reset_client_socket (man, false); @@ -1910,12 +1973,13 @@ man_write (struct management *man) { const int len = min_int (size_hint, BLEN (buf)); #ifdef TARGET_ANDROID - if (man->connection.fdtosend > 0) { - sent = write_fd (man->connection.sd_cli, BPTR (buf), len, MSG_NOSIGNAL,man->connection.fdtosend); + if (man->connection.fdtosend > 0) + { + sent = write_fd (man->connection.sd_cli, BPTR (buf), len, MSG_NOSIGNAL,man->connection.fdtosend); man->connection.fdtosend = -1; } else #endif - sent = send (man->connection.sd_cli, BPTR (buf), len, MSG_NOSIGNAL); + sent = send (man->connection.sd_cli, BPTR (buf), len, MSG_NOSIGNAL); if (sent >= 0) { buffer_list_advance (man->connection.out, sent); @@ -2910,7 +2974,7 @@ management_event_loop_n_seconds (struct management *man, int sec) * Get a username/password from management channel in standalone mode. */ bool - management_query_user_pass (struct management *man, +management_query_user_pass (struct management *man, struct user_pass *up, const char *type, const unsigned int flags, @@ -3108,79 +3172,6 @@ management_query_rsa_sig (struct management *man, #endif -#ifdef TARGET_ANDROID -static ssize_t write_fd (int fd, void *ptr, size_t nbytes, int flags, int sendfd) -{ - struct msghdr msg; - struct iovec iov[1]; - - union { - struct cmsghdr cm; - char control[CMSG_SPACE(sizeof(int))]; - } control_un; - struct cmsghdr *cmptr; - - msg.msg_control = control_un.control; - msg.msg_controllen = sizeof(control_un.control); - - cmptr = CMSG_FIRSTHDR(&msg); - cmptr->cmsg_len = CMSG_LEN(sizeof(int)); - cmptr->cmsg_level = SOL_SOCKET; - cmptr->cmsg_type = SCM_RIGHTS; - *((int *) CMSG_DATA(cmptr)) = sendfd; - - msg.msg_name = NULL; - msg.msg_namelen = 0; - - iov[0].iov_base = ptr; - iov[0].iov_len = nbytes; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - - return (sendmsg(fd, &msg, flags)); -} - -static ssize_t read_fd(int fd, void *ptr, size_t nbytes, int flags, int *recvfd) -{ - struct msghdr msghdr; - struct iovec iov[1]; - ssize_t n; - - union { - struct cmsghdr cm; - char control[CMSG_SPACE(sizeof (int))]; - } control_un; - struct cmsghdr *cmptr; - - msghdr.msg_control = control_un.control; - msghdr.msg_controllen = sizeof(control_un.control); - - msghdr.msg_name = NULL; - msghdr.msg_namelen = 0; - - iov[0].iov_base = ptr; - iov[0].iov_len = nbytes; - msghdr.msg_iov = iov; - msghdr.msg_iovlen = 1; - - if ( (n = recvmsg(fd, &msghdr, flags)) <= 0) - return (n); - - if ( (cmptr = CMSG_FIRSTHDR(&msghdr)) != NULL && - cmptr->cmsg_len == CMSG_LEN(sizeof(int))) { - if (cmptr->cmsg_level != SOL_SOCKET) - msg (M_ERR, "control level != SOL_SOCKET"); - if (cmptr->cmsg_type != SCM_RIGHTS) - msg (M_ERR, "control type != SCM_RIGHTS"); - *recvfd = *((int *) CMSG_DATA(cmptr)); - } else - *recvfd = -1; /* descriptor was not passed */ - - return (n); -} -#endif - - /* * Return true if management_hold() would block */ diff --git a/openvpn/src/openvpn/manage.h b/openvpn/src/openvpn/manage.h index c7ffb42a..991b4896 100644 --- a/openvpn/src/openvpn/manage.h +++ b/openvpn/src/openvpn/manage.h @@ -208,7 +208,7 @@ struct man_persist { bool hold_release; const char *special_state_msg; - + counter_type bytes_in; counter_type bytes_out; }; @@ -307,7 +307,6 @@ struct man_connection { int fdtosend; int lastfdreceived; #endif - }; struct management diff --git a/openvpn/src/openvpn/misc.c b/openvpn/src/openvpn/misc.c index 3658c348..2ded9bfc 100644 --- a/openvpn/src/openvpn/misc.c +++ b/openvpn/src/openvpn/misc.c @@ -1176,7 +1176,7 @@ get_user_pass_cr (struct user_pass *up, if (ac) { char *response = (char *) gc_malloc (USER_PASS_LEN, false, &gc); - struct buffer packed_resp; + struct buffer packed_resp; buf_set_write (&packed_resp, (uint8_t*)up->password, USER_PASS_LEN); msg (M_INFO|M_NOPREFIX, "CHALLENGE: %s", ac->challenge_text); diff --git a/openvpn/src/openvpn/openvpn.vcxproj b/openvpn/src/openvpn/openvpn.vcxproj index 8ec8d901..51e19aff 100644 --- a/openvpn/src/openvpn/openvpn.vcxproj +++ b/openvpn/src/openvpn/openvpn.vcxproj @@ -1,261 +1,261 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {29DF226E-4D4E-440F-ADAF-5829CFD4CA94} - openvpn - Win32Proj - - - - Application - MultiByte - true - - - Application - MultiByte - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Platform)-Output\$(Configuration)\ - $(Configuration)\ - true - $(SolutionDir)$(Platform)-Output\$(Configuration)\ - $(Configuration)\ - false - - - - Disabled - $(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - $(SOURCEBASE);%(AdditionalIncludeDirectories) - - - libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;shell32.lib;%(AdditionalDependencies) - $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) - true - Console - MachineX86 - - - - - MaxSpeed - true - $(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - $(SOURCEBASE);%(AdditionalIncludeDirectories) - - - libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;shell32.lib;%(AdditionalDependencies) - $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX86 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {8598c2c8-34c4-47a1-99b0-7c295a890615} - false - - - {4b2e2719-e661-45d7-9203-f6f456b22f19} - false - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94} + openvpn + Win32Proj + + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(Configuration)\ + false + + + + Disabled + $(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;shell32.lib;%(AdditionalDependencies) + $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + + + MaxSpeed + true + $(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;shell32.lib;%(AdditionalDependencies) + $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) + true + Console + true + true + MachineX86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {8598c2c8-34c4-47a1-99b0-7c295a890615} + false + + + {4b2e2719-e661-45d7-9203-f6f456b22f19} + false + + + + + \ No newline at end of file diff --git a/openvpn/src/openvpn/openvpn.vcxproj.filters b/openvpn/src/openvpn/openvpn.vcxproj.filters index 40336ba8..ec5e676c 100644 --- a/openvpn/src/openvpn/openvpn.vcxproj.filters +++ b/openvpn/src/openvpn/openvpn.vcxproj.filters @@ -1,458 +1,458 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + \ No newline at end of file diff --git a/openvpn/src/openvpn/options.c b/openvpn/src/openvpn/options.c index dcb6340e..7b7fc684 100644 --- a/openvpn/src/openvpn/options.c +++ b/openvpn/src/openvpn/options.c @@ -35,6 +35,9 @@ #elif defined(_MSC_VER) #include "config-msvc.h" #endif +#ifdef HAVE_CONFIG_VERSION_H +#include "config-version.h" +#endif #include "syshead.h" @@ -859,6 +862,7 @@ init_options (struct options *o, const bool init_gc) o->pkcs11_pin_cache_period = -1; #endif /* ENABLE_PKCS11 */ +#ifdef ENABLE_TMPDIR /* Set default --tmp-dir */ #ifdef WIN32 /* On Windows, find temp dir via enviroment variables */ @@ -870,6 +874,7 @@ init_options (struct options *o, const bool init_gc) o->tmp_dir = "/tmp"; } #endif /* WIN32 */ +#endif /* ENABLE_TMPDIR */ } void @@ -1047,22 +1052,6 @@ string_substitute (const char *src, int from, int to, struct gc_arena *gc) return ret; } -bool -is_persist_option (const struct options *o) -{ - return o->persist_tun - || o->persist_key - || o->persist_local_ip - || o->persist_remote_ip - ; -} - -bool -is_stateful_restart (const struct options *o) -{ - return is_persist_option (o) || connection_list_defined (o); -} - #ifdef ENABLE_SSL static uint8_t * parse_hash_fingerprint(const char *str, int nbytes, int msglevel, struct gc_arena *gc) @@ -2774,19 +2763,21 @@ options_postprocess_filechecks (struct options *options) options->management_user_pass, R_OK, "--management user/password file"); #endif /* ENABLE_MANAGEMENT */ -#if P2MP +#if ENABLE_TMPDIR errs |= check_file_access (CHKACC_FILE|CHKACC_ACPTSTDIN, options->auth_user_pass_file, R_OK, "--auth-user-pass"); -#endif /* P2MP */ + + errs |= check_file_access (CHKACC_FILE, options->tmp_dir, + R_OK|W_OK|X_OK, "Temporary directory (--tmp-dir)"); + +#endif /* ENABLE_TMPDIR */ /* ** System related ** */ errs |= check_file_access (CHKACC_FILE, options->chroot_dir, R_OK|X_OK, "--chroot directory"); errs |= check_file_access (CHKACC_DIRPATH|CHKACC_FILEXSTWR, options->writepid, R_OK|W_OK, "--writepid"); - errs |= check_file_access (CHKACC_FILE, options->tmp_dir, - R_OK|W_OK|X_OK, "Temporary directory (--tmp-dir)"); /* ** Log related ** */ errs |= check_file_access (CHKACC_DIRPATH|CHKACC_FILEXSTWR, options->status_file, @@ -3483,6 +3474,9 @@ usage_version (void) #ifdef CONFIGURE_DEFINES msg (M_INFO|M_NOPREFIX, "Compile time defines: %s", CONFIGURE_DEFINES); #endif +#ifdef CONFIGURE_GIT_REVISION + msg (M_INFO|M_NOPREFIX, "git revision: %s", CONFIGURE_GIT_REVISION); +#endif #endif openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */ } @@ -4033,8 +4027,8 @@ void options_string_import (struct options *options, static bool verify_permission (const char *name, - const char* file, - const unsigned int type, + const char* file, + const unsigned int type, const unsigned int allowed, unsigned int *found, const int msglevel) @@ -5473,11 +5467,6 @@ add_option (struct options *options, options->occ = false; } #endif - else if (streq (p[0], "tmp-dir") && p[1]) - { - VERIFY_PERMISSION (OPT_P_GENERAL); - options->tmp_dir = p[1]; - } #if P2MP #if P2MP_SERVER else if (streq (p[0], "server") && p[1] && p[2]) @@ -5759,6 +5748,11 @@ add_option (struct options *options, warn_multiple_script (options->learn_address_script, "learn-address"); options->learn_address_script = p[1]; } + else if (streq (p[0], "tmp-dir") && p[1]) + { + VERIFY_PERMISSION (OPT_P_GENERAL); + options->tmp_dir = p[1]; + } else if (streq (p[0], "client-config-dir") && p[1]) { VERIFY_PERMISSION (OPT_P_GENERAL); diff --git a/openvpn/src/openvpn/options.h b/openvpn/src/openvpn/options.h index 1be3dfaf..50d42fb7 100644 --- a/openvpn/src/openvpn/options.h +++ b/openvpn/src/openvpn/options.h @@ -403,7 +403,9 @@ struct options struct plugin_option_list *plugin_list; #endif +#ifdef ENABLE_TMPDIR const char *tmp_dir; +#endif #if P2MP @@ -749,9 +751,6 @@ bool apply_push_options (struct options *options, unsigned int *option_types_found, struct env_set *es); -bool is_persist_option (const struct options *o); -bool is_stateful_restart (const struct options *o); - void options_detach (struct options *o); void options_server_import (struct options *o, diff --git a/openvpn/src/openvpn/socket.c b/openvpn/src/openvpn/socket.c index b92c2828..d417172a 100644 --- a/openvpn/src/openvpn/socket.c +++ b/openvpn/src/openvpn/socket.c @@ -40,7 +40,6 @@ #include "misc.h" #include "manage.h" - #include "memdbg.h" const int proto_overhead[] = { /* indexed by PROTO_x */ @@ -375,7 +374,7 @@ getaddr6 (unsigned int flags, /* * Resolve hostname - */ + */ while (true) { /* try hostname lookup */ @@ -859,7 +858,8 @@ create_socket_tcp (void) msg (M_SOCKERR, "TCP: Cannot setsockopt SO_LINGER on TCP socket"); } #endif - return sd; + + return sd; } static socket_descriptor_t @@ -886,7 +886,6 @@ create_socket_udp (const unsigned int flags) #endif } #endif - return sd; } @@ -906,7 +905,6 @@ create_socket_udp6 (const unsigned int flags) msg(M_SOCKERR, "UDP: failed setsockopt for IPV6_RECVPKTINFO"); } #endif - return sd; } @@ -1328,7 +1326,7 @@ socket_connect (socket_descriptor_t *sd, } /* For stream protocols, allocate a buffer to build up packet. - Called after frame has been finalized. */ + Called after frame has been finalized. */ static void socket_frame_init (const struct frame *frame, struct link_socket *sock) diff --git a/openvpn/src/openvpn/syshead.h b/openvpn/src/openvpn/syshead.h index 8ce40f7e..ed00e821 100644 --- a/openvpn/src/openvpn/syshead.h +++ b/openvpn/src/openvpn/syshead.h @@ -506,6 +506,7 @@ socket_defined (const socket_descriptor_t sd) #if P2MP && !defined(ENABLE_CLIENT_ONLY) #define P2MP_SERVER 1 +#define ENABLE_TMPDIR 1 #else #define P2MP_SERVER 0 #endif diff --git a/openvpn/src/openvpn/tun.c b/openvpn/src/openvpn/tun.c index 92ad001e..8057c16e 100644 --- a/openvpn/src/openvpn/tun.c +++ b/openvpn/src/openvpn/tun.c @@ -46,10 +46,10 @@ #include "manage.h" #include "route.h" #include "win32.h" + #include "memdbg.h" #include - #ifdef WIN32 /* #define SIMULATE_DHCP_FAILED */ /* simulate bad DHCP negotiation */ @@ -1739,7 +1739,7 @@ read_tun (struct tuntap* tt, uint8_t *buf, int len) ret = readv(tt->fd, vect, 2); return(ret - sizeof(pi)); } - else + else return read (tt->fd, buf, len); } diff --git a/openvpn/src/openvpn/tun.h b/openvpn/src/openvpn/tun.h index 095e77eb..0f4f0123 100644 --- a/openvpn/src/openvpn/tun.h +++ b/openvpn/src/openvpn/tun.h @@ -76,7 +76,6 @@ struct tuntap_options { int netbios_node_type; /* NBT 1,2,4,8 (46) */ - #define N_DHCP_ADDR 4 /* Max # of addresses allowed for DNS, WINS, etc. */ @@ -315,8 +314,6 @@ route_order(void) } - - #ifdef WIN32 #define TUN_PASS_BUFFER diff --git a/openvpn/src/openvpnserv/openvpnserv.vcxproj b/openvpn/src/openvpnserv/openvpnserv.vcxproj index 0b75ed01..f2c00718 100644 --- a/openvpn/src/openvpnserv/openvpnserv.vcxproj +++ b/openvpn/src/openvpnserv/openvpnserv.vcxproj @@ -1,112 +1,112 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD} - openvpnserv - Win32Proj - - - - Application - MultiByte - true - - - Application - MultiByte - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Platform)-Output\$(Configuration)\ - $(Configuration)\ - true - $(SolutionDir)$(Platform)-Output\$(Configuration)\ - $(Configuration)\ - false - - - - Disabled - $(SOURCEBASE);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - - - Level3 - EditAndContinue - - - $(SOURCEBASE);%(AdditionalIncludeDirectories) - - - true - Console - MachineX86 - - - - - MaxSpeed - true - $(SOURCEBASE);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - - - $(SOURCEBASE);%(AdditionalIncludeDirectories) - - - true - Console - true - true - MachineX86 - - - - - - - - - - - - - - - {8598c2c8-34c4-47a1-99b0-7c295a890615} - false - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD} + openvpnserv + Win32Proj + + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(Configuration)\ + false + + + + Disabled + $(SOURCEBASE);%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + true + Console + MachineX86 + + + + + MaxSpeed + true + $(SOURCEBASE);%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + true + Console + true + true + MachineX86 + + + + + + + + + + + + + + + {8598c2c8-34c4-47a1-99b0-7c295a890615} + false + + + + + \ No newline at end of file diff --git a/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters b/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters index 0c89b4f4..a6f8ecc6 100644 --- a/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters +++ b/openvpn/src/openvpnserv/openvpnserv.vcxproj.filters @@ -1,35 +1,35 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - - - Header Files - - - - - Resource Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + + + Header Files + + + + + Resource Files + + \ No newline at end of file diff --git a/openvpn/tests/Makefile.am b/openvpn/tests/Makefile.am index 6ae845ba..b7980e04 100644 --- a/openvpn/tests/Makefile.am +++ b/openvpn/tests/Makefile.am @@ -12,13 +12,12 @@ MAINTAINERCLEANFILES = \ $(srcdir)/Makefile.in -test_scripts = t_lpback.sh t_cltsrv.sh +test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)" TESTS = $(test_scripts) dist_noinst_SCRIPTS = \ $(test_scripts) \ - t_cltsrv-down.sh \ - t_client.sh + t_cltsrv-down.sh diff --git a/openvpn/tests/t_client.sh.in b/openvpn/tests/t_client.sh.in index 7ba124c9..d58b8210 100755 --- a/openvpn/tests/t_client.sh.in +++ b/openvpn/tests/t_client.sh.in @@ -14,16 +14,19 @@ srcdir="${srcdir:-.}" top_builddir="${top_builddir:-..}" -if [ -r "${srcdir}"/t_client.rc ] ; then +if [ -r "${top_builddir}"/t_client.rc ] ; then + . "${top_builddir}"/t_client.rc +elif [ -r "${srcdir}"/t_client.rc ] ; then . "${srcdir}"/t_client.rc else - echo "$0: cannot find 't_client.rc' in ('${srcdir}'). SKIPPING TEST." >&2 + echo "$0: cannot find 't_client.rc' in build dir ('${top_builddir}')" >&2 + echo "$0: or source directory ('${srcdir}'). SKIPPING TEST." >&2 exit 77 fi if [ ! -x "${top_builddir}/src/openvpn/openvpn" ] then - echo "no (executable) openvpn binary in current directory. FAIL." >&2 + echo "no (executable) openvpn binary in current build tree. FAIL." >&2 exit 1 fi @@ -83,12 +86,12 @@ fail() get_ifconfig_route() { # linux / iproute2? (-> if configure got a path) - if [ "@IPROUTE@" != "ip" ] + if [ -n "@IPROUTE@" ] then echo "-- linux iproute2 --" @IPROUTE@ addr show | grep -v valid_lft @IPROUTE@ route show - @IPROUTE@ -6 route show | sed -e 's/expires [0-9]*sec //' + @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -e 's/expires [0-9]*sec //' return fi @@ -236,7 +239,7 @@ do trap "$RUN_SUDO kill $opid ; trap - 0 ; exit 1" 1 2 3 15 echo "wait for connection to establish..." - sleep 10 + sleep ${SETUP_TIME_WAIT:-10} # test whether OpenVPN process is still there if $RUN_SUDO kill -0 $opid diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index 936a88c6..e800e3d3 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -149,10 +149,11 @@ public class VpnProfile implements Serializable{ cfg+= "management-query-passwords\n"; cfg += "management-hold\n\n"; + /* tmp-dir patched out :) cfg+="# /tmp does not exist on Android\n"; cfg+="tmp-dir "; cfg+=cacheDir.getAbsolutePath(); - cfg+="\n\n"; + cfg+="\n\n"; */ cfg+="# Log window is better readable this way\n"; cfg+="suppress-timestamps\n"; -- cgit v1.2.3