From: Lennart Poettering Date: Wed, 24 Mar 2010 19:59:42 +0000 (+0100) Subject: add a couple of FIXMEs to broken code X-Git-Tag: v0.36~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=691f3f98f6c249e01e1a5b336a19198482db0d55;p=thirdparty%2Flibcgroup.git add a couple of FIXMEs to broken code Signed-off-by: Lennart Poettering Acked-by: Dhaval Giani Signed-off-by: Dhaval Giani --- diff --git a/src/api.c b/src/api.c index 365ab216..cb708d79 100644 --- a/src/api.c +++ b/src/api.c @@ -498,6 +498,9 @@ static int cgroup_parse_rules(bool cache, uid_t muid, matched = false; continue; } + + /* FIXME: basename() modifies the string and really shouldn't! */ + if (strcmp(mprocname, procname) && strcmp(basename(mprocname), procname)) { uid = CGRULE_INVALID; @@ -827,6 +830,9 @@ static char *cg_build_path_locked(const char *name, char *path, const char *type if (name) { char *tmp; tmp = strdup(path); + + /* FIXME: missing OOM check here! */ + sprintf(path, "%s%s/", tmp, name); free(tmp); } @@ -2179,6 +2185,9 @@ static struct cgroup_rule *cgroup_find_matching_rule(uid_t uid, break; if (!strcmp(ret->procname, procname)) break; + + /* FIXME: basename() modifies the string and really shouldn't! */ + if (!strcmp(ret->procname, basename(procname))) /* Check a rule of basename. */ break;