]> Pileus Git - ~andy/linux/blobdiff - security/tomoyo/gc.c
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
[~andy/linux] / security / tomoyo / gc.c
index e0502b6d5866e575950fb17adce2b6dab411ddce..ae135fbbbe955b922c0fe3dbe6d8d158dc6fa9d1 100644 (file)
@@ -1,10 +1,7 @@
 /*
  * security/tomoyo/gc.c
  *
- * Implementation of the Domain-Based Mandatory Access Control.
- *
- * Copyright (C) 2005-2010  NTT DATA CORPORATION
- *
+ * Copyright (C) 2005-2011  NTT DATA CORPORATION
  */
 
 #include "common.h"
@@ -358,6 +355,8 @@ void tomoyo_del_condition(struct list_head *element)
        const u16 condc = cond->condc;
        const u16 numbers_count = cond->numbers_count;
        const u16 names_count = cond->names_count;
+       const u16 argc = cond->argc;
+       const u16 envc = cond->envc;
        unsigned int i;
        const struct tomoyo_condition_element *condp
                = (const struct tomoyo_condition_element *) (cond + 1);
@@ -365,10 +364,20 @@ void tomoyo_del_condition(struct list_head *element)
                = (struct tomoyo_number_union *) (condp + condc);
        struct tomoyo_name_union *names_p
                = (struct tomoyo_name_union *) (numbers_p + numbers_count);
+       const struct tomoyo_argv *argv
+               = (const struct tomoyo_argv *) (names_p + names_count);
+       const struct tomoyo_envp *envp
+               = (const struct tomoyo_envp *) (argv + argc);
        for (i = 0; i < numbers_count; i++)
                tomoyo_put_number_union(numbers_p++);
        for (i = 0; i < names_count; i++)
                tomoyo_put_name_union(names_p++);
+       for (i = 0; i < argc; argv++, i++)
+               tomoyo_put_name(argv->value);
+       for (i = 0; i < envc; envp++, i++) {
+               tomoyo_put_name(envp->name);
+               tomoyo_put_name(envp->value);
+       }
 }
 
 /**
@@ -443,7 +452,7 @@ static bool tomoyo_collect_member(const enum tomoyo_policy_id id,
                if (!tomoyo_add_to_gc(id, &member->list))
                        return false;
        }
-        return true;
+       return true;
 }
 
 /**