Add setuid & setgid call to execute backend with the correct user/GID context sandbox/durandba1/9.38.199.IntegrationBackend
authorBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Fri, 5 Sep 2014 15:00:11 +0000 (17:00 +0200)
committerBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Fri, 5 Sep 2014 15:35:30 +0000 (17:35 +0200)
Change-Id: I748e69aeabf36f844088898304e65fa0c0480863
Signed-off-by: Baptiste DURAND <baptiste.durand@open.eurogiciel.org>
server/src/pkgmgr-server.c

index c91b565..8fc68a7 100755 (executable)
@@ -1650,9 +1650,11 @@ pop:
 
                        /* Execute backend !!! */
                        user_context = getUserContext(item->uid);
-                       if(user_context)
+                       if(user_context) {
+                               setgid(user_context->gid);
+                               setuid(item->uid);
                                ret = execve(backend_cmd, args_vector,user_context->env);
-                       else {
+                       else {
                                ret = -1;
                                perror("fail to retreive user context");
                                exit(1);