From: Hyuk Lee Date: Thu, 14 Apr 2016 05:34:52 +0000 (+0900) Subject: Set the daemon UID/GID to network_fw X-Git-Tag: accepted/tizen/common/20160414.142756^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abb81b5d6742810f2968708388a40a6e5ea3b0be;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-share.git Set the daemon UID/GID to network_fw Change-Id: I800c1560c74d0491c59663f2ca3d234932d7eeab Signed-off-by: Hyuk Lee --- diff --git a/bt-share/src/bt-share-main.c b/bt-share/src/bt-share-main.c index 28f01a6..71e9920 100644 --- a/bt-share/src/bt-share-main.c +++ b/bt-share/src/bt-share-main.c @@ -37,6 +37,10 @@ #include "bt-share-common.h" #include "bt-share-cynara.h" +#include +#include +#include + #include "bluetooth-share-api.h" #include "notification_internal.h" @@ -333,6 +337,15 @@ int main(void) if (appcore_set_i18n(BT_COMMON_PKG, BT_COMMON_RES) < 0) return -1; + uid_t network_user = 551; /* uid of network_fw */ + gid_t network_group = 551; /* gid of network_fw */ + + initgroups("network_fw", network_group); + ret = setgid(network_group); + DBG("setgid return : %d", ret); + ret = setuid(network_user); + DBG("setuid return : %d", ret); + if (_bt_share_cynara_init()) { ERR("Failed to initialize Cynara.\n"); return -1;