diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2012-02-11 13:56:27 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2012-02-11 13:56:27 -0800 |
commit | d8f9e8310dac362bb9578763d1024178f94f4ecc (patch) | |
tree | 46fe14ad3caed79b4656ff519efaac5188dcaa96 /common/os_calls.c | |
parent | a866b7b3306dd20e0836de50cd40f94456fcd560 (diff) | |
download | xrdp-proprietary-d8f9e8310dac362bb9578763d1024178f94f4ecc.tar.gz xrdp-proprietary-d8f9e8310dac362bb9578763d1024178f94f4ecc.zip |
move temp files from /tmp to /tmp/.xrdp
Diffstat (limited to 'common/os_calls.c')
-rw-r--r-- | common/os_calls.c | 10 |
1 files changed, 8 insertions, 2 deletions
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); |