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); diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c index 77fbcd50..f2ca961d 100644 --- a/sesman/chansrv/chansrv.c +++ b/sesman/chansrv/chansrv.c @@ -411,7 +411,7 @@ setup_listen(void) if (g_use_unix_socket) { g_lis_trans = trans_create(2, 8192, 8192); - g_snprintf(port, 255, "/tmp/xrdp_chansrv_socket_%d", 7200 + g_display_num); + g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d", 7200 + g_display_num); } else { diff --git a/sesman/sessvc/sessvc.c b/sesman/sessvc/sessvc.c index fe268abc..088f4f51 100644 --- a/sesman/sessvc/sessvc.c +++ b/sesman/sessvc/sessvc.c @@ -56,12 +56,12 @@ chansrv_cleanup(int pid) { char text[256]; - g_snprintf(text, 255, "/tmp/xrdp_chansrv_%8.8x_main_term", pid); + g_snprintf(text, 255, "/tmp/.xrdp/xrdp_chansrv_%8.8x_main_term", pid); if (g_file_exist(text)) { g_file_delete(text); } - g_snprintf(text, 255, "/tmp/xrdp_chansrv_%8.8x_thread_done", pid); + g_snprintf(text, 255, "/tmp/.xrdp/xrdp_chansrv_%8.8x_thread_done", pid); if (g_file_exist(text)) { g_file_delete(text); diff --git a/sesman/tools/dis.c b/sesman/tools/dis.c index 4a1ef78c..0dbc74d8 100644 --- a/sesman/tools/dis.c +++ b/sesman/tools/dis.c @@ -49,7 +49,7 @@ int main(int argc, char** argv) dis = strtol(display + 1, &p, 10); memset(&sa, 0, sizeof(sa)); sa.sun_family = AF_UNIX; - sprintf(sa.sun_path, "/tmp/xrdp_disconnect_display_%d", dis); + sprintf(sa.sun_path, "/tmp/.xrdp/xrdp_disconnect_display_%d", dis); if (access(sa.sun_path, F_OK) != 0) { printf("not in an xrdp session\n"); diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index be6786ad..d8c9c581 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -702,7 +702,7 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s) { /* unix socket */ self->chan_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192); - g_snprintf(port, 255, "/tmp/xrdp_chansrv_socket_%d", 7200 + display); + g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d", 7200 + display); } else {