projects
/
platform
/
core
/
appfw
/
pkgmgr-server.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f546e0
)
fix wrong behavior of pkg_getsize
55/91655/1
accepted/tizen/common/20161011.061126
accepted/tizen/ivi/20161011.234023
accepted/tizen/mobile/20161011.234005
accepted/tizen/tv/20161011.234014
accepted/tizen/wearable/20161011.233941
submit/tizen/20161011.002253
author
jongmyeongko
<jongmyeong.ko@samsung.com>
Mon, 10 Oct 2016 14:35:34 +0000
(23:35 +0900)
committer
jongmyeongko
<jongmyeong.ko@samsung.com>
Mon, 10 Oct 2016 14:35:34 +0000
(23:35 +0900)
- set uid/gid for pkg_getsize
Change-Id: I57c33ae74d33148350520776d34db24bcc5ba6c9
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/pkgmgr-server.c
patch
|
blob
|
history
diff --git
a/src/pkgmgr-server.c
b/src/pkgmgr-server.c
index
6ef1661
..
764894a
100644
(file)
--- 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");