Change the SMACK label for PUBLIC domain. 93/20193/2 submit/tizen/20140430.015858
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 29 Apr 2014 08:00:58 +0000 (17:00 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 29 Apr 2014 08:07:59 +0000 (17:07 +0900)
Currently, this service is not able to be activated by systemd.socket.
Instead of activating by systemd, I will do labeling the socket file using smack_fset function.

After I can see the service is running well, I will try change it to be activated by systemd-socket.
But it requires some more testing and stabilizing, before change it, I need to see whether the service is running well or not.

Is it possible to activate the one service process via multiple socket files?

Change-Id: Ifed525bcc906be2f7b49791e668223285b202494

src/badge_service.c
src/notification_service.c
src/shortcut_service.c
src/utility_service.c

index cdc0e82..be4ba57 100755 (executable)
@@ -552,7 +552,7 @@ HAPI int badge_service_init(void)
                return LB_STATUS_ERROR_FAULT;
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), BADGE_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "@", SMACK_LABEL_IPOUT) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);
@@ -561,7 +561,7 @@ HAPI int badge_service_init(void)
                }
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), BADGE_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "*", SMACK_LABEL_IPIN) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);
index 2f00587..8035b18 100755 (executable)
@@ -668,7 +668,7 @@ HAPI int notification_service_init(void)
                return LB_STATUS_ERROR_FAULT;
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), NOTIFICATION_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "@", SMACK_LABEL_IPOUT) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);
@@ -677,7 +677,7 @@ HAPI int notification_service_init(void)
                }
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), NOTIFICATION_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "*", SMACK_LABEL_IPIN) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);
index 9905717..618c285 100644 (file)
@@ -215,7 +215,7 @@ HAPI int shortcut_service_init(void)
                return LB_STATUS_ERROR_FAULT;
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), SHORTCUT_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "@", SMACK_LABEL_IPOUT) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);
@@ -224,7 +224,7 @@ HAPI int shortcut_service_init(void)
                }
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), SHORTCUT_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "*", SMACK_LABEL_IPIN) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);
index e3d9837..f19aaf0 100644 (file)
@@ -413,7 +413,7 @@ int utility_service_init(void)
                return LB_STATUS_ERROR_FAULT;
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), UTILITY_SMACK_LABEL, SMACK_LABEL_IPOUT) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "@", SMACK_LABEL_IPOUT) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);
@@ -422,7 +422,7 @@ int utility_service_init(void)
                }
        }
 
-       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), UTILITY_SMACK_LABEL, SMACK_LABEL_IPIN) != 0) {
+       if (smack_fsetlabel(service_common_fd(s_info.svc_ctx), "*", SMACK_LABEL_IPIN) != 0) {
                if (errno != EOPNOTSUPP) {
                        ErrPrint("Unable to set SMACK label(%d)\n", errno);
                        service_common_destroy(s_info.svc_ctx);