From 58c9cb43e9e83a6f5cc8a13cd84aa67cce8cacd5 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 14 Mar 2017 21:45:50 -0700 Subject: Make socket directory configurable, don't hardcode /tmp/.xrdp Use XRDP_SOCKET_PATH in file_loc.h Don't define any non-socket paths in file_loc.h, they should come from the makefiles. Define all paths unconditionally, they should not be defined elsewhere. Pass XRDP_SOCKET_PATH as environment variable to the backends. --- common/os_calls.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'common/os_calls.c') diff --git a/common/os_calls.c b/common/os_calls.c index f85e5d2e..a0d8ce1a 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -111,18 +111,19 @@ g_rm_temp_dir(void) int g_mk_temp_dir(const char *app_name) { - if (!g_directory_exist("/tmp/.xrdp")) + if (!g_directory_exist(XRDP_SOCKET_PATH)) { - if (!g_create_dir("/tmp/.xrdp")) + if (!g_create_dir(XRDP_SOCKET_PATH)) { /* if failed, still check if it got created by someone else */ - if (!g_directory_exist("/tmp/.xrdp")) + if (!g_directory_exist(XRDP_SOCKET_PATH)) { - printf("g_mk_temp_dir: g_create_dir failed\n"); + printf("g_mk_temp_dir: g_create_dir(%s) failed\n", + XRDP_SOCKET_PATH); return 1; } } - g_chmod_hex("/tmp/.xrdp", 0x1777); + g_chmod_hex(XRDP_SOCKET_PATH, 0x1777); } return 0; } -- cgit v1.2.1