From 691f3f98f6c249e01e1a5b336a19198482db0d55 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 24 Mar 2010 20:59:42 +0100 Subject: add a couple of FIXMEs to broken code Signed-off-by: Lennart Poettering Acked-by: Dhaval Giani Signed-off-by: Dhaval Giani --- src/api.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api.c b/src/api.c index 365ab21..cb708d7 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; -- cgit