SELinux: conditional.c whitespace, syntax, and static declaraction cleanups
This patch changes conditional.c to fix whitespace and syntax issues. Things that are fixed may include (does not not have to include) whitespace at end of lines spaces followed by tabs spaces used instead of tabs spacing around parenthesis locateion of { around struct and else clauses location of * in pointer declarations removal of initialization of static data to keep it in the right section useless {} in if statemetns useless checking for NULL before kfree fixing of the indentation depth of switch statements and any number of other things I forgot to mention Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
Родитель
eb5df9a7ae
Коммит
7c2b240ef2
|
@ -99,22 +99,20 @@ int evaluate_cond_node(struct policydb *p, struct cond_node *node)
|
|||
printk(KERN_ERR "SELinux: expression result was undefined - disabling all rules.\n");
|
||||
/* turn the rules on or off */
|
||||
for (cur = node->true_list; cur != NULL; cur = cur->next) {
|
||||
if (new_state <= 0) {
|
||||
if (new_state <= 0)
|
||||
cur->node->key.specified &= ~AVTAB_ENABLED;
|
||||
} else {
|
||||
else
|
||||
cur->node->key.specified |= AVTAB_ENABLED;
|
||||
}
|
||||
}
|
||||
|
||||
for (cur = node->false_list; cur != NULL; cur = cur->next) {
|
||||
/* -1 or 1 */
|
||||
if (new_state) {
|
||||
if (new_state)
|
||||
cur->node->key.specified &= ~AVTAB_ENABLED;
|
||||
} else {
|
||||
else
|
||||
cur->node->key.specified |= AVTAB_ENABLED;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -252,8 +250,7 @@ err:
|
|||
return -1;
|
||||
}
|
||||
|
||||
struct cond_insertf_data
|
||||
{
|
||||
struct cond_insertf_data {
|
||||
struct policydb *p;
|
||||
struct cond_av_list *other;
|
||||
struct cond_av_list *head;
|
||||
|
@ -353,9 +350,8 @@ static int cond_read_av_list(struct policydb *p, void *fp, struct cond_av_list *
|
|||
return -1;
|
||||
|
||||
len = le32_to_cpu(buf[0]);
|
||||
if (len == 0) {
|
||||
if (len == 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
data.p = p;
|
||||
data.other = other;
|
||||
|
@ -414,9 +410,8 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
|
|||
goto err;
|
||||
|
||||
expr = kzalloc(sizeof(struct cond_expr), GFP_KERNEL);
|
||||
if (!expr) {
|
||||
if (!expr)
|
||||
goto err;
|
||||
}
|
||||
|
||||
expr->expr_type = le32_to_cpu(buf[0]);
|
||||
expr->bool = le32_to_cpu(buf[1]);
|
||||
|
@ -426,11 +421,10 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
if (i == 0)
|
||||
node->expr = expr;
|
||||
} else {
|
||||
else
|
||||
last->next = expr;
|
||||
}
|
||||
last = expr;
|
||||
}
|
||||
|
||||
|
@ -469,11 +463,10 @@ int cond_read_list(struct policydb *p, void *fp)
|
|||
if (cond_read_node(p, node, fp) != 0)
|
||||
goto err;
|
||||
|
||||
if (i == 0) {
|
||||
if (i == 0)
|
||||
p->cond_list = node;
|
||||
} else {
|
||||
else
|
||||
last->next = node;
|
||||
}
|
||||
last = node;
|
||||
}
|
||||
return 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче