]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
There is the problem that cgrulesengd cannot get Gid from /proc/PID/status,
authorMasayuki Igawa <igawa@mxs.nes.nec.co.jp>
Thu, 14 May 2009 05:14:35 +0000 (10:44 +0530)
committerBalbir Singh <balbir@linux.vnet.ibm.com>
Thu, 14 May 2009 05:14:35 +0000 (10:44 +0530)
because the function breaks just after getting Uid data:

 $ cat /proc/$$/status
 [snip]
 Uid:    500     500     500     500
 Gid:    500     500     500     500
 [snip]
 $

This patch fixes this problem.

Signed-off-by: Masayuki Igawa <igawa@mxs.nes.nec.co.jp>
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
src/daemon/cgrulesengd.c

index 07d4a5de474a8a9a334f2ffbb09d3e129b7aed96..595c3215aadfdf32267461ce6c100e2fa0ce594d 100644 (file)
@@ -168,11 +168,9 @@ static int cgre_get_euid_egid_from_status(pid_t pid, uid_t *euid, gid_t *egid)
                if (!strncmp(buf, "Uid:", 4)) {
                        sscanf((buf + 5), "%d%d%d%d", &ruid, euid,
                                &suid, &fsuid);
-                       break;
                } else if (!strncmp(buf, "Gid:", 4)) {
                        sscanf((buf + 5), "%d%d%d%d", &rgid, egid,
                                &sgid, &fsgid);
-                       break;
                }
                memset(buf, '\0', sizeof(buf));
        }