mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
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>
This commit is contained in:
committed by
Paul Moore
parent
ec4a491d18
commit
447a568800
@@ -38,7 +38,7 @@ static int cond_evaluate_expr(struct policydb *p, struct cond_expr *expr)
|
|||||||
if (sp == (COND_EXPR_MAXDEPTH - 1))
|
if (sp == (COND_EXPR_MAXDEPTH - 1))
|
||||||
return -1;
|
return -1;
|
||||||
sp++;
|
sp++;
|
||||||
s[sp] = p->bool_val_to_struct[node->bool - 1]->state;
|
s[sp] = p->bool_val_to_struct[node->boolean - 1]->state;
|
||||||
break;
|
break;
|
||||||
case COND_NOT:
|
case COND_NOT:
|
||||||
if (sp < 0)
|
if (sp < 0)
|
||||||
@@ -366,7 +366,7 @@ static int expr_node_isvalid(struct policydb *p, struct cond_expr_node *expr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expr->bool > p->p_bools.nprim) {
|
if (expr->boolean > p->p_bools.nprim) {
|
||||||
pr_err("SELinux: conditional expressions uses unknown bool.\n");
|
pr_err("SELinux: conditional expressions uses unknown bool.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -401,7 +401,7 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp)
|
|||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
expr->expr_type = le32_to_cpu(buf[0]);
|
expr->expr_type = le32_to_cpu(buf[0]);
|
||||||
expr->bool = le32_to_cpu(buf[1]);
|
expr->boolean = le32_to_cpu(buf[1]);
|
||||||
|
|
||||||
if (!expr_node_isvalid(p, expr))
|
if (!expr_node_isvalid(p, expr))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -518,7 +518,7 @@ static int cond_write_node(struct policydb *p, struct cond_node *node,
|
|||||||
|
|
||||||
for (i = 0; i < node->expr.len; i++) {
|
for (i = 0; i < node->expr.len; i++) {
|
||||||
buf[0] = cpu_to_le32(node->expr.nodes[i].expr_type);
|
buf[0] = cpu_to_le32(node->expr.nodes[i].expr_type);
|
||||||
buf[1] = cpu_to_le32(node->expr.nodes[i].bool);
|
buf[1] = cpu_to_le32(node->expr.nodes[i].boolean);
|
||||||
rc = put_entry(buf, sizeof(u32), 2, fp);
|
rc = put_entry(buf, sizeof(u32), 2, fp);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
@@ -29,7 +29,7 @@ struct cond_expr_node {
|
|||||||
#define COND_NEQ 7 /* bool != bool */
|
#define COND_NEQ 7 /* bool != bool */
|
||||||
#define COND_LAST COND_NEQ
|
#define COND_LAST COND_NEQ
|
||||||
u32 expr_type;
|
u32 expr_type;
|
||||||
u32 bool;
|
u32 boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cond_expr {
|
struct cond_expr {
|
||||||
|
Reference in New Issue
Block a user