Skip to content

Commit 447a568

Browse files
cgzonespcmoore
authored andcommitted
selinux: avoid bool as identifier name
Avoid using the identifier `bool` to improve support with future C standards. C23 is about to make `bool` a predefined macro (see N2654). Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent ec4a491 commit 447a568

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

security/selinux/ss/conditional.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int cond_evaluate_expr(struct policydb *p, struct cond_expr *expr)
3838
if (sp == (COND_EXPR_MAXDEPTH - 1))
3939
return -1;
4040
sp++;
41-
s[sp] = p->bool_val_to_struct[node->bool - 1]->state;
41+
s[sp] = p->bool_val_to_struct[node->boolean - 1]->state;
4242
break;
4343
case COND_NOT:
4444
if (sp < 0)
@@ -366,7 +366,7 @@ static int expr_node_isvalid(struct policydb *p, struct cond_expr_node *expr)
366366
return 0;
367367
}
368368

369-
if (expr->bool > p->p_bools.nprim) {
369+
if (expr->boolean > p->p_bools.nprim) {
370370
pr_err("SELinux: conditional expressions uses unknown bool.\n");
371371
return 0;
372372
}
@@ -401,7 +401,7 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
401401
return rc;
402402

403403
expr->expr_type = le32_to_cpu(buf[0]);
404-
expr->bool = le32_to_cpu(buf[1]);
404+
expr->boolean = le32_to_cpu(buf[1]);
405405

406406
if (!expr_node_isvalid(p, expr))
407407
return -EINVAL;
@@ -518,7 +518,7 @@ static int cond_write_node(struct policydb *p, struct cond_node *node,
518518

519519
for (i = 0; i < node->expr.len; i++) {
520520
buf[0] = cpu_to_le32(node->expr.nodes[i].expr_type);
521-
buf[1] = cpu_to_le32(node->expr.nodes[i].bool);
521+
buf[1] = cpu_to_le32(node->expr.nodes[i].boolean);
522522
rc = put_entry(buf, sizeof(u32), 2, fp);
523523
if (rc)
524524
return rc;

security/selinux/ss/conditional.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct cond_expr_node {
2929
#define COND_NEQ 7 /* bool != bool */
3030
#define COND_LAST COND_NEQ
3131
u32 expr_type;
32-
u32 bool;
32+
u32 boolean;
3333
};
3434

3535
struct cond_expr {

0 commit comments

Comments
 (0)