From d8f9e8310dac362bb9578763d1024178f94f4ecc Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 11 Feb 2012 13:56:27 -0800 Subject: move temp files from /tmp to /tmp/.xrdp --- common/os_calls.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'common/os_calls.c') diff --git a/common/os_calls.c b/common/os_calls.c index a38eb396..bbec959f 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -79,7 +79,7 @@ extern char** environ; #define INADDR_NONE ((unsigned long)-1) #endif -static char g_temp_base[64] = ""; +static char g_temp_base[128] = ""; /*****************************************************************************/ void APP_CC @@ -95,7 +95,13 @@ g_init(const char* app_name) { if (app_name[0] != 0) { - snprintf(g_temp_base, sizeof(g_temp_base), "/tmp/%s-XXXXXX", app_name); + if (!g_directory_exist("/tmp/.xrdp")) + { + g_create_dir("/tmp/.xrdp"); + g_chmod_hex("/tmp/.xrdp", 0x1777); + } + snprintf(g_temp_base, sizeof(g_temp_base), "/tmp/.xrdp/%s-XXXXXX", + app_name); if (mkdtemp(g_temp_base) == 0) { printf("g_init: mkdtemp failed [%s]\n", g_temp_base); -- cgit v1.2.1