summaryrefslogtreecommitdiff
path: root/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2017-07-26 12:11:29 -0300
committerStefan Schmidt <stefan@osg.samsung.com>2017-07-27 16:54:16 +0200
commit97f6803be14212c8b5fb70071e312cf1e51f8fe5 (patch)
treee28fd8c5d877654c86c07fd440a41f3958d8fbe2 /src/lib/ecore_ipc
parent0787b739cddd1df0bc33312d0f048e308e509373 (diff)
Ecore_IPC: Preserve Ecore_Con legacy behaviour.
This patch sets some Ecore_Con flags that were missing after the EO migration. These flags must be set in order maintain the Ecore_IPC behaviour before Ecore_Con EO was implemented. Fixes T5722
Diffstat (limited to 'src/lib/ecore_ipc')
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index e9973f30a7..8cb7f3f7e8 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -386,6 +386,7 @@ ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void
386 char *address = NULL; 386 char *address = NULL;
387 Eina_Error err; 387 Eina_Error err;
388#ifdef EFL_NET_SERVER_UNIX_CLASS 388#ifdef EFL_NET_SERVER_UNIX_CLASS
389 Eina_Bool local_system = EINA_FALSE;
389 mode_t old_mask = 0, new_mask = 0; 390 mode_t old_mask = 0, new_mask = 0;
390#endif 391#endif
391 392
@@ -415,6 +416,7 @@ ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void
415 /* ecore_con didn't create leading directories for LOCAL_SYSTEM */ 416 /* ecore_con didn't create leading directories for LOCAL_SYSTEM */
416 417
417 new_mask = 0; 418 new_mask = 0;
419 local_system = EINA_TRUE;
418 420
419 svr->server = efl_add(EFL_NET_SERVER_UNIX_CLASS, ecore_main_loop_get()); 421 svr->server = efl_add(EFL_NET_SERVER_UNIX_CLASS, ecore_main_loop_get());
420 EINA_SAFETY_ON_NULL_GOTO(svr->server, error_server); 422 EINA_SAFETY_ON_NULL_GOTO(svr->server, error_server);
@@ -477,9 +479,36 @@ ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void
477 479
478 efl_event_callback_array_add(svr->server, _ecore_ipc_server_cbs(), svr); 480 efl_event_callback_array_add(svr->server, _ecore_ipc_server_cbs(), svr);
479 481
482 if (efl_isa(svr->server, EFL_NET_SERVER_FD_CLASS))
483 {
484 efl_net_server_fd_close_on_exec_set(svr->server, EINA_TRUE);
485 efl_net_server_fd_reuse_address_set(svr->server, EINA_TRUE);
486 efl_net_server_fd_reuse_port_set(svr->server, EINA_TRUE);
487 }
488
489 if (efl_isa(svr->server, EFL_NET_SERVER_TCP_CLASS))
490 {
491 /* old ecore_con did not map ipv4 to ipv6... */
492 efl_net_server_tcp_ipv6_only_set(svr->server, EINA_TRUE);
493 }
494 else if (efl_isa(svr->server, EFL_NET_SERVER_SSL_CLASS))
495 {
496 /* old ecore_con did not map ipv4 to ipv6... */
497 efl_net_server_ssl_ipv6_only_set(svr->server, EINA_TRUE);
498 efl_net_server_ssl_close_on_exec_set(svr->server, EINA_TRUE);
499 efl_net_server_ssl_reuse_address_set(svr->server, EINA_TRUE);
500 efl_net_server_ssl_reuse_port_set(svr->server, EINA_TRUE);
501 }
502
480#ifdef EFL_NET_SERVER_UNIX_CLASS 503#ifdef EFL_NET_SERVER_UNIX_CLASS
481 if (efl_isa(svr->server, EFL_NET_SERVER_UNIX_CLASS)) 504 if (efl_isa(svr->server, EFL_NET_SERVER_UNIX_CLASS))
482 old_mask = umask(new_mask); 505 {
506 old_mask = umask(new_mask);
507 efl_net_server_unix_unlink_before_bind_set(svr->server, EINA_TRUE);
508 efl_net_server_unix_leading_directories_create_set(svr->server,
509 EINA_TRUE,
510 local_system ? 0755 : 0700);
511 }
483#endif 512#endif
484 513
485 err = efl_net_server_serve(svr->server, address); 514 err = efl_net_server_serve(svr->server, address);