summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/openvpn/options.c7
-rw-r--r--src/openvpn/options.h4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 1cb6068..6eac407 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -858,6 +858,8 @@ init_options (struct options *o, const bool init_gc)
o->pkcs11_pin_cache_period = -1;
#endif /* ENABLE_PKCS11 */
+/* tmp is only used in P2MP server context */
+#if P2MP_SERVER
/* Set default --tmp-dir */
#ifdef WIN32
/* On Windows, find temp dir via enviroment variables */
@@ -869,6 +871,7 @@ init_options (struct options *o, const bool init_gc)
o->tmp_dir = "/tmp";
}
#endif /* WIN32 */
+#endif /* P2MP_SERVER */
}
void
@@ -2766,8 +2769,6 @@ options_postprocess_filechecks (struct options *options)
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,
@@ -2781,6 +2782,8 @@ options_postprocess_filechecks (struct options *options)
#if P2MP_SERVER
errs |= check_file_access (CHKACC_FILE, options->client_config_dir,
R_OK|X_OK, "--client-config-dir");
+ errs |= check_file_access (CHKACC_FILE, options->tmp_dir,
+ R_OK|W_OK|X_OK, "Temporary directory (--tmp-dir)");
/* ** Script hooks that accept an optionally quoted and/or escaped executable path, ** */
/* ** optionally followed by arguments ** */
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index 9b6adea..ee0c69d 100644
--- a/src/openvpn/options.h
+++ b/src/openvpn/options.h
@@ -399,11 +399,13 @@ struct options
struct plugin_option_list *plugin_list;
#endif
- const char *tmp_dir;
+
#if P2MP
#if P2MP_SERVER
+ /* the tmp dir is for now only used in the P2P server context */
+ const char *tmp_dir;
bool server_defined;
in_addr_t server_network;
in_addr_t server_netmask;