mirror of https://github.com/neutrinolabs/xrdp
move temp files from /tmp to /tmp/.xrdp
This commit is contained in:
parent
a866b7b330
commit
d8f9e8310d
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue