@@ -193,45 +193,6 @@ sesman_process_params(int argc, char **argv,
193193 return 0 ;
194194}
195195
196- /******************************************************************************/
197- static int
198- create_sesman_runtime_dir (void )
199- {
200- int rv = -1 ;
201- /* Make sure if we create the directory, there's no gap where it
202- * may have the wrong permissions */
203- int entry_umask = g_umask_hex (0x755 );
204-
205- if (!g_directory_exist (SESMAN_RUNTIME_PATH ) &&
206- !g_create_dir (SESMAN_RUNTIME_PATH ))
207- {
208- LOG (LOG_LEVEL_ERROR ,
209- "Can't create runtime directory '"
210- SESMAN_RUNTIME_PATH "' [%s]" , g_get_strerror ());
211- }
212- else if (g_chown (SESMAN_RUNTIME_PATH , g_getuid (), g_getuid ()) != 0 )
213- {
214- LOG (LOG_LEVEL_ERROR ,
215- "Can't set ownership of sesman runtime directory [%s]" ,
216- g_get_strerror ());
217- }
218- else if (g_chmod_hex (SESMAN_RUNTIME_PATH , 0x755 ) != 0 )
219- {
220- /* This might seem redundant, but there's a chance the
221- * directory already exists */
222- LOG (LOG_LEVEL_ERROR ,
223- "Can't set permissions of sesman runtime directory [%s]" ,
224- g_get_strerror ());
225- }
226- else
227- {
228- rv = 0 ;
229- }
230- g_umask_hex (entry_umask );
231-
232- return rv ;
233- }
234-
235196/******************************************************************************/
236197static int sesman_listen_test (struct config_sesman * cfg )
237198{
@@ -694,24 +655,24 @@ create_xrdp_socket_root_path(void)
694655
695656 /* Create the path using 0755 permissions */
696657 int old_umask = g_umask_hex (0x22 );
697- (void )g_create_path (XRDP_SOCKET_PATH "/" );
658+ (void )g_create_path (XRDP_SOCKET_ROOT_PATH "/" );
698659 (void )g_umask_hex (old_umask );
699660
700661 /* Check the ownership and permissions on the last path element
701662 * are as expected */
702- if (g_chown (XRDP_SOCKET_PATH , uid , gid ) != 0 )
663+ if (g_chown (XRDP_SOCKET_ROOT_PATH , uid , gid ) != 0 )
703664 {
704665 LOG (LOG_LEVEL_ERROR ,
705666 "create_xrdp_socket_root_path: Can't set owner of %s to %d:%d" ,
706- XRDP_SOCKET_PATH , uid , gid );
667+ XRDP_SOCKET_ROOT_PATH , uid , gid );
707668 return 1 ;
708669 }
709670
710- if (g_chmod_hex (XRDP_SOCKET_PATH , 0x755 ) != 0 )
671+ if (g_chmod_hex (XRDP_SOCKET_ROOT_PATH , 0x755 ) != 0 )
711672 {
712673 LOG (LOG_LEVEL_ERROR ,
713674 "create_xrdp_socket_root_path: Can't set perms of %s to 0x755" ,
714- XRDP_SOCKET_PATH );
675+ XRDP_SOCKET_ROOT_PATH );
715676 return 1 ;
716677 }
717678
@@ -887,9 +848,9 @@ main(int argc, char **argv)
887848 }
888849 }
889850
890- /* Create the runtime directory before we try to listen (or
851+ /* Create the socket directory before we try to listen (or
891852 * test-listen), so there's somewhere for the default socket to live */
892- if (create_sesman_runtime_dir () != 0 )
853+ if (create_xrdp_socket_root_path () != 0 )
893854 {
894855 config_free (g_cfg );
895856 log_end ();
@@ -963,9 +924,6 @@ main(int argc, char **argv)
963924 LOG (LOG_LEVEL_INFO ,
964925 "starting xrdp-sesman with pid %d" , g_pid );
965926
966- /* make sure the socket directory exists */
967- create_xrdp_socket_root_path ();
968-
969927 /* make sure the /tmp/.X11-unix directory exists */
970928 if (!g_directory_exist ("/tmp/.X11-unix" ))
971929 {
0 commit comments