Skip to content

Commit

Permalink
selinux: Change bool variable name to index.
Browse files Browse the repository at this point in the history
security_get_bool_value(int bool) argument "bool" conflicts with
in-kernel macros such as BUILD_BUG().  This patch changes this to
index which isn't a type.

Cc: Paul Moore <[email protected]>
Cc: Stephen Smalley <[email protected]>
Cc: Eric Paris <[email protected]>
Cc: James Morris <[email protected]>
Cc: "Serge E. Hallyn" <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Andrew Perepechko <[email protected]>
Cc: Jeff Vander Stoep <[email protected]>
Cc: [email protected]
Cc: Eric Paris <[email protected]>
Cc: Paul Moore <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Prarit Bhargava <[email protected]>
Acked-by: David Howells <[email protected]>
[PM: wrapped description for checkpatch.pl, use "selinux:..." as subj]
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
prarit authored and pcmoore committed Apr 14, 2016
1 parent 61d612e commit 0fd71a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion security/selinux/include/conditional.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ int security_get_bools(int *len, char ***names, int **values);

int security_set_bools(int len, int *values);

int security_get_bool_value(int bool);
int security_get_bool_value(int index);

#endif
6 changes: 3 additions & 3 deletions security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,7 @@ int security_set_bools(int len, int *values)
return rc;
}

int security_get_bool_value(int bool)
int security_get_bool_value(int index)
{
int rc;
int len;
Expand All @@ -2705,10 +2705,10 @@ int security_get_bool_value(int bool)

rc = -EFAULT;
len = policydb.p_bools.nprim;
if (bool >= len)
if (index >= len)
goto out;

rc = policydb.bool_val_to_struct[bool]->state;
rc = policydb.bool_val_to_struct[index]->state;
out:
read_unlock(&policy_rwlock);
return rc;
Expand Down

0 comments on commit 0fd71a6

Please sign in to comment.