From: jongmyeongko Date: Mon, 10 Oct 2016 14:35:34 +0000 (+0900) Subject: fix wrong behavior of pkg_getsize X-Git-Tag: accepted/tizen/common/20161011.061126^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F91655%2F1;p=platform%2Fcore%2Fappfw%2Fpkgmgr-server.git fix wrong behavior of pkg_getsize - set uid/gid for pkg_getsize Change-Id: I57c33ae74d33148350520776d34db24bcc5ba6c9 Signed-off-by: jongmyeongko --- diff --git a/src/pkgmgr-server.c b/src/pkgmgr-server.c index 6ef1661..764894a 100644 --- a/src/pkgmgr-server.c +++ b/src/pkgmgr-server.c @@ -533,6 +533,18 @@ int set_environement(user_ctx *ctx) if (!ctx) return -1; + if (ctx->uid != APPFW_UID) { + if (setuid(ctx->uid)) { + ERR("setuid failed: %d", errno); + return -1; + } + + if (setgid(ctx->gid)) { + ERR("setgid failed: %d", errno); + return -1; + } + } + n = getgroups(0, NULL); if (n < 0) { ERR("Failed to get the number of supplementary group IDs");