You can subscribe to this list here.
| 2002 | Jan | Feb | Mar | Apr (24) | May (14) | Jun (29) | Jul (33) | Aug (3) | Sep (8) | Oct (18) | Nov (1) | Dec (10) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 | Jan (3) | Feb (33) | Mar (7) | Apr (28) | May (30) | Jun (5) | Jul (10) | Aug (7) | Sep (32) | Oct (41) | Nov (20) | Dec (10) |
| 2004 | Jan (24) | Feb (18) | Mar (57) | Apr (40) | May (55) | Jun (48) | Jul (77) | Aug (15) | Sep (56) | Oct (80) | Nov (74) | Dec (52) |
| 2005 | Jan (38) | Feb (42) | Mar (39) | Apr (56) | May (79) | Jun (73) | Jul (16) | Aug (23) | Sep (68) | Oct (77) | Nov (52) | Dec (27) |
| 2006 | Jan (27) | Feb (18) | Mar (51) | Apr (62) | May (28) | Jun (50) | Jul (36) | Aug (33) | Sep (47) | Oct (50) | Nov (77) | Dec (13) |
| 2007 | Jan (15) | Feb (8) | Mar (14) | Apr (18) | May (25) | Jun (16) | Jul (16) | Aug (19) | Sep (32) | Oct (17) | Nov (5) | Dec (5) |
| 2008 | Jan (64) | Feb (25) | Mar (25) | Apr (6) | May (28) | Jun (20) | Jul (10) | Aug (27) | Sep (28) | Oct (59) | Nov (37) | Dec (43) |
| 2009 | Jan (40) | Feb (25) | Mar (12) | Apr (57) | May (46) | Jun (29) | Jul (39) | Aug (10) | Sep (20) | Oct (42) | Nov (50) | Dec (57) |
| 2010 | Jan (82) | Feb (165) | Mar (256) | Apr (260) | May (36) | Jun (87) | Jul (53) | Aug (89) | Sep (107) | Oct (51) | Nov (88) | Dec (117) |
| 2011 | Jan (69) | Feb (60) | Mar (113) | Apr (71) | May (67) | Jun (90) | Jul (88) | Aug (90) | Sep (48) | Oct (64) | Nov (69) | Dec (118) |
| 2012 | Jan (49) | Feb (528) | Mar (351) | Apr (190) | May (238) | Jun (193) | Jul (104) | Aug (100) | Sep (57) | Oct (41) | Nov (47) | Dec (51) |
| 2013 | Jan (94) | Feb (57) | Mar (96) | Apr (105) | May (77) | Jun (102) | Jul (27) | Aug (81) | Sep (32) | Oct (53) | Nov (127) | Dec (65) |
| 2014 | Jan (113) | Feb (59) | Mar (104) | Apr (259) | May (70) | Jun (70) | Jul (146) | Aug (45) | Sep (58) | Oct (149) | Nov (77) | Dec (83) |
| 2015 | Jan (53) | Feb (66) | Mar (86) | Apr (50) | May (135) | Jun (76) | Jul (151) | Aug (83) | Sep (97) | Oct (262) | Nov (245) | Dec (231) |
| 2016 | Jan (131) | Feb (233) | Mar (97) | Apr (138) | May (221) | Jun (254) | Jul (92) | Aug (248) | Sep (168) | Oct (275) | Nov (477) | Dec (445) |
| 2017 | Jan (218) | Feb (217) | Mar (146) | Apr (172) | May (216) | Jun (252) | Jul (164) | Aug (192) | Sep (190) | Oct (143) | Nov (255) | Dec (182) |
| 2018 | Jan (295) | Feb (164) | Mar (113) | Apr (147) | May (64) | Jun (262) | Jul (184) | Aug (90) | Sep (69) | Oct (364) | Nov (102) | Dec (101) |
| 2019 | Jan (119) | Feb (64) | Mar (64) | Apr (102) | May (57) | Jun (154) | Jul (84) | Aug (81) | Sep (76) | Oct (102) | Nov (233) | Dec (89) |
| 2020 | Jan (38) | Feb (170) | Mar (155) | Apr (172) | May (120) | Jun (223) | Jul (461) | Aug (227) | Sep (268) | Oct (113) | Nov (56) | Dec (124) |
| 2021 | Jan (121) | Feb (48) | Mar (334) | Apr (345) | May (207) | Jun (136) | Jul (71) | Aug (112) | Sep (122) | Oct (173) | Nov (184) | Dec (223) |
| 2022 | Jan (197) | Feb (206) | Mar (156) | Apr (212) | May (192) | Jun (170) | Jul (143) | Aug (380) | Sep (182) | Oct (148) | Nov (128) | Dec (269) |
| 2023 | Jan (248) | Feb (196) | Mar (264) | Apr (36) | May (123) | Jun (66) | Jul (120) | Aug (48) | Sep (157) | Oct (198) | Nov (300) | Dec (273) |
| 2024 | Jan (271) | Feb (147) | Mar (207) | Apr (78) | May (107) | Jun (168) | Jul (151) | Aug (51) | Sep (438) | Oct (221) | Nov (302) | Dec (357) |
| 2025 | Jan (451) | Feb (219) | Mar (326) | Apr (232) | May (306) | Jun (181) | Jul (452) | Aug (282) | Sep (620) | Oct (793) | Nov (682) | Dec (17) |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| | | | | | 1 | 2 |
| 3 (1) | 4 | 5 | 6 (1) | 7 (11) | 8 (11) | 9 (3) |
| 10 | 11 (5) | 12 (1) | 13 | 14 (10) | 15 (14) | 16 (1) |
| 17 | 18 | 19 | 20 (3) | 21 (3) | 22 | 23 |
| 24 | 25 | 26 | 27 (2) | 28 (2) | 29 (3) | 30 |
| From: David S. <da...@re...> - 2011-04-06 16:10:19 |
In commit 4e1cc5f6dda22e9 the create_temp_filename() function was reviewed and hardened, which in the end renamed this function to create_temp_file() in commit 495e3cec5d156. With these changes it became more evident that OpenVPN needs a directory where it can create temporary files. The create_temp_file() will create such files f.ex. if --client-connect or --plugin which makes use of the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY hook, such as openvpn-auth-pam.so. When this happens, OpenVPN will normally create these files in the directory OpenVPN was started. In many cases, this will fail due to restricted access. By using --tmp-dir and pointing it to a directory writeable to the user running OpenVPN, it works again. This patch makes OpenVPN use a more suitable temproary directory by default, instead of the current working directory. On non-Windows platforms this default value is set to '/tmp', but can be modified at compile-time by running ./configure --with-tmp-dir-path=<TEMP DIR PATH>. On Windows, it will look up %TEMP% and %TMP% first, and if that doesn't give any clues, it will fallback to C:\WINDOWS\Temp in the end. In any cases, this default value can be overridden in the configuration file by using the --tmp-dir option, as before. To check what the default is at runime, you can see this easily by doing this: $ ./openvpn --verb 4 --dev tun | grep tmp_dir Signed-off-by: David Sommerseth <da...@re...> Tested-by: Jan Just Keijser <ja...@ni...> --- configure.ac | 11 +++++++++++ options.c | 15 +++++++++++---- win/config.h.in | 3 +++ win32.c | 19 +++++++++++++++++++ win32.h | 3 +++ 5 files changed, 47 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e0847bc..a9f022e 100644 --- a/configure.ac +++ b/configure.ac @@ -279,6 +279,11 @@ AC_ARG_WITH(netstat-path, ) AC_DEFINE_UNQUOTED(NETSTAT_PATH, "$NETSTAT", [Path to netstat tool]) +AC_ARG_WITH(tmp-dir-path, + [ --with-tmp-dir-path=PATH Default tmp-dir to use when not configured (unset defaults to /tmp)], + [TMPDIRPATH="$withval"] +) + AC_ARG_WITH(mem-check, [ --with-mem-check=TYPE Build with debug memory checking, TYPE = dmalloc or valgrind], [MEMCHECK="$withval"] @@ -566,6 +571,12 @@ LDFLAGS="$LDFLAGS -Wl,--fatal-warnings" AC_CHECK_FUNC(epoll_create, AC_DEFINE(HAVE_EPOLL_CREATE, 1, [epoll_create function is defined])) LDFLAGS="$OLDLDFLAGS" +dnl set the default temporary directory +if test -z "$TMPDIRPATH"; then + TMPDIRPATH="/tmp" +fi +AC_DEFINE_UNQUOTED(DEFAULT_TMPDIR, "$TMPDIRPATH", [Default --tmp-dir]) + dnl dnl check for valgrind tool dnl diff --git a/options.c b/options.c index 36e8393..0b91657 100644 --- a/options.c +++ b/options.c @@ -766,11 +766,20 @@ init_options (struct options *o, const bool init_gc) #ifdef ENABLE_X509ALTUSERNAME o->x509_username_field = X509_USERNAME_FIELD_DEFAULT; #endif -#endif -#endif +#endif /* USE_SSL */ +#endif /* USE_CRYPTO */ #ifdef ENABLE_PKCS11 o->pkcs11_pin_cache_period = -1; #endif /* ENABLE_PKCS11 */ + + /* Set default --tmp-dir */ +#ifdef WIN32 + /* On Windows, find temp dir via enviroment variables */ + o->tmp_dir = win_get_tempdir(); +#else + /* Non-windows platforms have this value defined via ./configure */ + o->tmp_dir = DEFAULT_TMPDIR; +#endif /* WIN32 */ } void @@ -1916,8 +1925,6 @@ options_postprocess_verify_ce (const struct options *options, const struct conne msg (M_USAGE, "--client-connect requires --mode server"); if (options->client_disconnect_script) msg (M_USAGE, "--client-disconnect requires --mode server"); - if (options->tmp_dir) - msg (M_USAGE, "--tmp-dir requires --mode server"); if (options->client_config_dir || options->ccd_exclusive) msg (M_USAGE, "--client-config-dir/--ccd-exclusive requires --mode server"); if (options->enable_c2c) diff --git a/win/config.h.in b/win/config.h.in index fb349d0..abf71d2 100644 --- a/win/config.h.in +++ b/win/config.h.in @@ -286,6 +286,9 @@ typedef unsigned long in_addr_t; /* Route command */ #define ROUTE_PATH "route" +/* Default temporary directory, if not found via getenv() */ +#define DEFAULT_TMPDIR "C:\\WINDOWS\\Temp" /* FIXME: Should be configurable */ + #ifdef _MSC_VER /* MSVC++ hacks */ #pragma warning(disable:4244) // conversion from 'foo' to 'bar', possible loss of data diff --git a/win32.c b/win32.c index 7c9901e..c9eb184 100644 --- a/win32.c +++ b/win32.c @@ -1093,4 +1093,23 @@ env_set_add_win32 (struct env_set *es) set_win_sys_path (DEFAULT_WIN_SYS_PATH, es); } + +const char * +win_get_tempdir() +{ + static char *tmpdir = NULL; + + /* Try to use %TEMP% or %TMP% */ + tmpdir = getenv("TEMP"); + if( !tmpdir ) { + tmpdir = getenv("TMP"); + } + if( !tmpdir ) { + /* Warn if we're using a hard coded path */ + msg (M_WARN, "Could not find %TEMP% or %TMP% environment variables. " + "Falling back to %s. Consider to use --tmp-dir", DEFAULT_TMPDIR); + tmpdir = DEFAULT_TMPDIR; + } + return tmpdir; +} #endif diff --git a/win32.h b/win32.h index fcc3062..b6a162e 100644 --- a/win32.h +++ b/win32.h @@ -270,5 +270,8 @@ char *get_win_sys_path (void); /* call self in a subprocess */ void fork_to_self (const char *cmdline); +/* Find temporary directory */ +const char *win_get_tempdir(); + #endif #endif -- 1.7.4 |