Eina_Stringshare *address_dial;
Eina_Bool connected;
double timeout_dial;
+ //TIZEN_ONLT(20200313): use compositor socket instead of socket4 for connection
+ int compositor_socket;
+ //
} Efl_Net_Dialer_Unix_Data;
EOLIAN static Eo*
o = efl_constructor(efl_super(o, MY_CLASS));
if (!o) return NULL;
+ //TIZEN_ONLT(20200313): use compositor socket instead of socket4 for connection
+ efl_net_dialer_unix_compositor_socket_set(o, -1);
+ //
+
efl_net_dialer_timeout_dial_set(o, 30.0);
return o;
}
EINA_SAFETY_ON_TRUE_RETURN_VAL(address[0] == '\0', EINVAL);
EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_net_dialer_connected_get(o), EISCONN);
EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_io_closer_closed_get(o), EBADF);
- // TIZEN ONLY (20180125): smack issue: use fd from E
- //EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_loop_fd_get(o) >= 0, EALREADY);
- //
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(efl_loop_fd_get(o) >= 0, EALREADY);
if (pd->connect.thread)
{
pd->connect.thread = efl_net_connect_async_with_fd_new((const struct sockaddr *)&addr, addrlen, SOCK_STREAM, 0,
efl_io_closer_close_on_exec_get(o),
_efl_net_dialer_unix_connected,
- efl_loop_fd_get(o), o);
+ pd->compositor_socket, o);
//
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->connect.thread, EINVAL);
return efl_io_closer_close(efl_super(o, MY_CLASS));
}
+//TIZEN_ONLT(20200313): use compositor socket instead of socket4 for connection
+EOLIAN static void
+_efl_net_dialer_unix_compositor_socket_set(Eo *o EINA_UNUSED, Efl_Net_Dialer_Unix_Data *pd, int socket)
+{
+ pd->compositor_socket = socket;
+}
+//
+
#include "efl_net_dialer_unix.eo.c"
implemented.
]]
+ //TIZEN_ONLY(20200313): use compositor socket instead of socket4 for connection
+ methods {
+ @property compositor_socket {
+ [[In Tizen, the security does not allow 1 application to create
+ socket and other applications to connect to that socket.
+ All sockets should be created by system daemon or service.
+
+ Therefore, we request the E compositor to create sockets for us.
+ This should be set before @Efl.Net.Dialer.dial.
+ ]]
+ set { }
+ values {
+ socket: int; [[Socket from E compositor.]]
+ }
+ }
+ }
+ //
+
implements {
Efl.Object.constructor;
Efl.Object.invalidate;
}
svr->dialer.dialer = efl_add(EFL_NET_DIALER_UNIX_CLASS, efl_main_loop_get());
+ //TIZEN_ONLY(20200313): use compositor socket instead of socket4 for connection
+ efl_net_dialer_unix_compositor_socket_set(svr->dialer.dialer, fd);
+ //
EINA_SAFETY_ON_NULL_GOTO(svr->dialer.dialer, error_dialer);
}
else if ((type & ECORE_IPC_TYPE) == ECORE_IPC_LOCAL_SYSTEM)
EINA_SAFETY_ON_NULL_GOTO(address, error_dialer);
svr->dialer.dialer = efl_add(EFL_NET_DIALER_UNIX_CLASS, efl_main_loop_get());
+ //TIZEN_ONLY(20200313): use compositor socket instead of socket4 for connection
+ efl_net_dialer_unix_compositor_socket_set(svr->dialer.dialer, fd);
+ //
EINA_SAFETY_ON_NULL_GOTO(svr->dialer.dialer, error_dialer);
}
#endif /* EFL_NET_DIALER_UNIX_CLASS */