ENDIF (LIVEBOX)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "${PROJECT_NAME}")
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/data-provider-master.rule DESTINATION /etc/smack/accesses.d)
# INCLUDE FOR BUILD & INSTALL .PO FILES
ADD_SUBDIRECTORY(res)
--- /dev/null
+data-provider-master::bin system::vconf_system r----- ------
+data-provider-master::bin data-provider-master::data r----- ------
+data-provider-master::bin samsung::vconf::dynamicbox rw---- ------
+data-provider-master::bin xorg rw---- ------
+data-provider-master::bin tizen::vconf::setting::admin rw---- ------
+data-provider-master::bin tizen::vconf::platform::r r----- ------
+data-provider-master::bin device::app_logging -w---- ------
+data-provider-master::bin device::sys_logging -w---- ------
+data-provider-master::bin tizen::vconf::public::r r----l ------
+data-provider-master::bin data-provider-master::share rwx--- ------
+data-provider-master::bin data-provider-master::db rw---- ------
+data-provider-master::bin pkgmgr::db rw----- ------
+data-provider-master::bin _ rw---- ------
+data-provider-master::bin security-server::api-privilege-by-pid rw---- ------
+data-provider-master::bin aul::launch --x--- ------
+data-provider-master::bin device::input rw---- ------
After=xorg.target
[Service]
+User=system
+Group=system
+SmackProcessLabel=data-provider-master::bin
Environment=BUFMGR_LOCK_TYPE="once"
Environment=BUFMGR_MAP_CACHE="true"
Type=notify
extern int tcb_client_type_set(struct tcb *tcb, enum tcb_type type);
extern int tcb_is_valid(struct service_context *svc_ctx, struct tcb *tcb);
-extern struct service_context *service_common_create(const char *addr, int (*service_thread_main)(struct tcb *tcb, struct packet *packet, void *data), void *data);
+extern struct service_context *service_common_create(const char *addr, const char *label, int (*service_thread_main)(struct tcb *tcb, struct packet *packet, void *data), void *data);
extern int service_common_destroy(struct service_context *svc_ctx);
extern int service_common_multicast_packet(struct tcb *tcb, struct packet *packet, int type);
chmod 750 /opt/usr/share/live_magazine/reader
chown 5000:5000 /opt/usr/share/live_magazine/always
chmod 750 /opt/usr/share/live_magazine/always
-chown 0:5000 /opt/dbspace/.widget.db
+chown 200:5000 /opt/dbspace/.widget.db
chmod 640 /opt/dbspace/.widget.db
-chown 0:5000 /opt/dbspace/.widget.db-journal
+chown 200:5000 /opt/dbspace/.widget.db-journal
chmod 640 /opt/dbspace/.widget.db-journal
vconftool set -t bool "memory/data-provider-master/started" 0 -i -u 5000 -f -s system::vconf_system
vconftool set -t int "memory/private/data-provider-master/restart_count" 0 -i -u 5000 -f -s data-provider-master
%files -n data-provider-master
%manifest %{name}.manifest
-%defattr(-,root,root,-)
+%defattr(-,system,system,-)
%{_bindir}/data-provider-master
%{_libdir}/systemd/system/multi-user.target.wants/data-provider-master.service
%{_libdir}/systemd/system/data-provider-master.service
/opt/usr/share/live_magazine/*
/opt/dbspace/.widget.db
/opt/dbspace/.widget.db-journal
+%{_sysconfdir}/smack/accesses.d/%{name}.rule
# End of a file
return WIDGET_ERROR_ALREADY_STARTED;
}
- s_info.svc_ctx = service_common_create(BADGE_SOCKET, service_thread_main, NULL);
+ s_info.svc_ctx = service_common_create(BADGE_SOCKET, BADGE_SMACK_LABEL, service_thread_main, NULL);
if (!s_info.svc_ctx) {
ErrPrint("Unable to activate service thread\n");
return WIDGET_ERROR_FAULT;
}
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), BADGE_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), BADGE_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
DbgPrint("Successfully initiated\n");
return WIDGET_ERROR_NONE;
}
return WIDGET_ERROR_FAULT;
}
- s_info.svc_ctx = service_common_create(FILE_SERVICE_ADDR, service_thread_main, NULL);
+ s_info.svc_ctx = service_common_create(FILE_SERVICE_ADDR, NULL, service_thread_main, NULL);
if (!s_info.svc_ctx) {
ErrPrint("Unable to activate service thread\n");
_notification_init();
- s_info.svc_ctx = service_common_create(NOTIFICATION_SOCKET, service_thread_main, NULL);
+ s_info.svc_ctx = service_common_create(NOTIFICATION_SOCKET, NOTIFICATION_SMACK_LABEL, service_thread_main, NULL);
if (!s_info.svc_ctx) {
ErrPrint("Unable to activate service thread\n");
return WIDGET_ERROR_FAULT;
}
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), NOTIFICATION_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), NOTIFICATION_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
DbgPrint("Successfully initiated\n");
return WIDGET_ERROR_NONE;
}
inst = package_find_instance_by_id(pkgname, id);
} else {
ErrPrint("slave is not valid (%s)\n", id);
- return WIDGET_STATUS_ERROR_INVALID_PARAMETER;
+ return WIDGET_ERROR_INVALID_PARAMETER;
}
} else {
inst = package_find_instance_by_id(pkgname, id);
ErrPrint("Failed to create a info socket\n");
}
- s_info.slave_fd = com_core_packet_server_init(SLAVE_SOCKET, s_slave_table);
+ s_info.slave_fd = com_core_packet_server_init_with_permission(SLAVE_SOCKET, s_slave_table, "data-provider-master::provider");
if (s_info.slave_fd < 0) {
ErrPrint("Failed to create a slave socket\n");
}
- smack_fsetlabel(s_info.slave_fd, "data-provider-master::provider", SMACK_LABEL_IPIN);
- smack_fsetlabel(s_info.slave_fd, "data-provider-master::provider", SMACK_LABEL_IPOUT);
-
- s_info.client_fd = com_core_packet_server_init(CLIENT_SOCKET, s_client_table);
+ s_info.client_fd = com_core_packet_server_init_with_permission(CLIENT_SOCKET, s_client_table, "data-provider-master::client");
if (s_info.client_fd < 0) {
ErrPrint("Failed to create a client socket\n");
}
- smack_fsetlabel(s_info.client_fd, "data-provider-master::client", SMACK_LABEL_IPIN);
- smack_fsetlabel(s_info.client_fd, "data-provider-master::client", SMACK_LABEL_IPOUT);
-
/*!
* \note
* remote://:8208
* Skip address to use the NULL.
*/
- s_info.remote_client_fd = com_core_packet_server_init("remote://:"CLIENT_PORT, s_client_table);
+ s_info.remote_client_fd = com_core_packet_server_init_with_permission("remote://:"CLIENT_PORT, s_client_table, "data-provider-master::client");
if (s_info.client_fd < 0) {
ErrPrint("Failed to create a remote client socket\n");
}
- smack_fsetlabel(s_info.remote_client_fd, "data-provider-master::client", SMACK_LABEL_IPIN);
- smack_fsetlabel(s_info.remote_client_fd, "data-provider-master::client", SMACK_LABEL_IPOUT);
-
- s_info.service_fd = com_core_packet_server_init(SERVICE_SOCKET, s_service_table);
+ s_info.service_fd = com_core_packet_server_init_with_permission(SERVICE_SOCKET, s_service_table, "data-provider-master");
if (s_info.service_fd < 0) {
ErrPrint("Faild to create a service socket\n");
}
- smack_fsetlabel(s_info.service_fd, "data-provider-master", SMACK_LABEL_IPIN);
- smack_fsetlabel(s_info.service_fd, "data-provider-master", SMACK_LABEL_IPOUT);
-
if (chmod(INFO_SOCKET, 0600) < 0) {
ErrPrint("info socket: %s\n", strerror(errno));
}
* \NOTE
* MAIN THREAD
*/
-HAPI struct service_context *service_common_create(const char *addr, int (*service_thread_main)(struct tcb *tcb, struct packet *packet, void *data), void *data)
+HAPI struct service_context *service_common_create(const char *addr, const char *label, int (*service_thread_main)(struct tcb *tcb, struct packet *packet, void *data), void *data)
{
int status;
struct service_context *svc_ctx;
return NULL;
}
- svc_ctx->fd = secure_socket_create_server(addr);
+ svc_ctx->fd = secure_socket_create_server_with_permission(addr, label);
if (svc_ctx->fd < 0) {
DbgFree(svc_ctx);
return NULL;
return WIDGET_ERROR_ALREADY_STARTED;
}
- s_info.svc_ctx = service_common_create(SHORTCUT_SOCKET, service_thread_main, NULL);
+ s_info.svc_ctx = service_common_create(SHORTCUT_SOCKET, SHORTCUT_SMACK_LABEL, service_thread_main, NULL);
if (!s_info.svc_ctx) {
ErrPrint("Unable to activate service thread\n");
return WIDGET_ERROR_FAULT;
}
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), SHORTCUT_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), SHORTCUT_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
DbgPrint("Successfully initiated\n");
return WIDGET_ERROR_NONE;
}
return WIDGET_ERROR_ALREADY_STARTED;
}
- s_info.svc_ctx = service_common_create(UTILITY_SOCKET, service_thread_main, NULL);
+ s_info.svc_ctx = service_common_create(UTILITY_SOCKET, UTILITY_SMACK_LABEL, service_thread_main, NULL);
if (!s_info.svc_ctx) {
ErrPrint("Unable to activate service thread\n");
return WIDGET_ERROR_FAULT;
}
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), UTILITY_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
- if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), UTILITY_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
- if (errno != EOPNOTSUPP) {
- ErrPrint("Unable to set SMACK label(%d)\n", errno);
- service_common_destroy(s_info.svc_ctx);
- s_info.svc_ctx = NULL;
- return WIDGET_ERROR_FAULT;
- }
- }
-
DbgPrint("Successfully initiated\n");
return WIDGET_ERROR_NONE;
}