@@ -193,45 +193,6 @@ sesman_process_params(int argc, char **argv,
193
193
return 0 ;
194
194
}
195
195
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
-
235
196
/******************************************************************************/
236
197
static int sesman_listen_test (struct config_sesman * cfg )
237
198
{
@@ -694,24 +655,24 @@ create_xrdp_socket_root_path(void)
694
655
695
656
/* Create the path using 0755 permissions */
696
657
int old_umask = g_umask_hex (0x22 );
697
- (void )g_create_path (XRDP_SOCKET_PATH "/" );
658
+ (void )g_create_path (XRDP_SOCKET_ROOT_PATH "/" );
698
659
(void )g_umask_hex (old_umask );
699
660
700
661
/* Check the ownership and permissions on the last path element
701
662
* are as expected */
702
- if (g_chown (XRDP_SOCKET_PATH , uid , gid ) != 0 )
663
+ if (g_chown (XRDP_SOCKET_ROOT_PATH , uid , gid ) != 0 )
703
664
{
704
665
LOG (LOG_LEVEL_ERROR ,
705
666
"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 );
707
668
return 1 ;
708
669
}
709
670
710
- if (g_chmod_hex (XRDP_SOCKET_PATH , 0x755 ) != 0 )
671
+ if (g_chmod_hex (XRDP_SOCKET_ROOT_PATH , 0x755 ) != 0 )
711
672
{
712
673
LOG (LOG_LEVEL_ERROR ,
713
674
"create_xrdp_socket_root_path: Can't set perms of %s to 0x755" ,
714
- XRDP_SOCKET_PATH );
675
+ XRDP_SOCKET_ROOT_PATH );
715
676
return 1 ;
716
677
}
717
678
@@ -887,9 +848,9 @@ main(int argc, char **argv)
887
848
}
888
849
}
889
850
890
- /* Create the runtime directory before we try to listen (or
851
+ /* Create the socket directory before we try to listen (or
891
852
* 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 )
893
854
{
894
855
config_free (g_cfg );
895
856
log_end ();
@@ -963,9 +924,6 @@ main(int argc, char **argv)
963
924
LOG (LOG_LEVEL_INFO ,
964
925
"starting xrdp-sesman with pid %d" , g_pid );
965
926
966
- /* make sure the socket directory exists */
967
- create_xrdp_socket_root_path ();
968
-
969
927
/* make sure the /tmp/.X11-unix directory exists */
970
928
if (!g_directory_exist ("/tmp/.X11-unix" ))
971
929
{
0 commit comments