diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-03-24 20:59:42 +0100 |
---|---|---|
committer | Dhaval Giani <dhaval.giani@gmail.com> | 2010-03-26 12:56:43 +0100 |
commit | 691f3f98f6c249e01e1a5b336a19198482db0d55 (patch) | |
tree | 41a83d436ee7541c1824d19bad4e0bbac72efce5 | |
parent | 127da29e9ab20a3be8096cbd7f7ff225a2ddd7b7 (diff) | |
download | libcg-691f3f98f6c249e01e1a5b336a19198482db0d55.tar.gz libcg-691f3f98f6c249e01e1a5b336a19198482db0d55.tar.xz libcg-691f3f98f6c249e01e1a5b336a19198482db0d55.zip |
add a couple of FIXMEs to broken code
Signed-off-by: Lennart Poettering <lennart@poettering.net>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
-rw-r--r-- | src/api.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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; |