Skip to content

Commit e5a5ca9

Browse files
committed
selinux: rename the {is,set}_enforcing() functions
Rename is_enforcing() to enforcing_enabled() and enforcing_set() to set_enforcing(). Signed-off-by: Paul Moore <[email protected]>
1 parent aa8e712 commit e5a5ca9

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

security/selinux/avc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ static noinline int avc_denied(u32 ssid, u32 tsid,
985985
if (flags & AVC_STRICT)
986986
return -EACCES;
987987

988-
if (is_enforcing(&selinux_state) &&
988+
if (enforcing_enabled(&selinux_state) &&
989989
!(avd->flags & AVD_FLAGS_PERMISSIVE))
990990
return -EACCES;
991991

security/selinux/hooks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5407,7 +5407,7 @@ static int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb)
54075407
sk->sk_protocol, nlh->nlmsg_type,
54085408
secclass_map[sksec->sclass - 1].name,
54095409
task_pid_nr(current), current->comm);
5410-
if (!is_enforcing(&selinux_state) ||
5410+
if (!enforcing_enabled(&selinux_state) ||
54115411
security_get_allow_unknown(&selinux_state))
54125412
err = 0;
54135413
}
@@ -6937,7 +6937,7 @@ static __init int selinux_init(void)
69376937
printk(KERN_INFO "SELinux: Initializing.\n");
69386938

69396939
memset(&selinux_state, 0, sizeof(selinux_state));
6940-
set_enforcing(&selinux_state, selinux_enforcing_boot);
6940+
enforcing_set(&selinux_state, selinux_enforcing_boot);
69416941
selinux_state.checkreqprot = selinux_checkreqprot_boot;
69426942
selinux_ss_init(&selinux_state.ss);
69436943

security/selinux/include/security.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,22 @@ void selinux_ss_init(struct selinux_ss **ss);
111111
extern struct selinux_state selinux_state;
112112

113113
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
114-
static inline bool is_enforcing(struct selinux_state *state)
114+
static inline bool enforcing_enabled(struct selinux_state *state)
115115
{
116116
return state->enforcing;
117117
}
118118

119-
static inline void set_enforcing(struct selinux_state *state, bool value)
119+
static inline void enforcing_set(struct selinux_state *state, bool value)
120120
{
121121
state->enforcing = value;
122122
}
123123
#else
124-
static inline bool is_enforcing(struct selinux_state *state)
124+
static inline bool enforcing_enabled(struct selinux_state *state)
125125
{
126126
return true;
127127
}
128128

129-
static inline void set_enforcing(struct selinux_state *state, bool value)
129+
static inline void enforcing_set(struct selinux_state *state, bool value)
130130
{
131131
}
132132
#endif

security/selinux/selinuxfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static ssize_t sel_read_enforce(struct file *filp, char __user *buf,
9898
ssize_t length;
9999

100100
length = scnprintf(tmpbuf, TMPBUFLEN, "%d",
101-
is_enforcing(&selinux_state));
101+
enforcing_enabled(&selinux_state));
102102
return simple_read_from_buffer(buf, count, ppos, tmpbuf, length);
103103
}
104104

@@ -128,7 +128,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
128128

129129
new_value = !!new_value;
130130

131-
old_value = is_enforcing(&selinux_state);
131+
old_value = enforcing_enabled(&selinux_state);
132132

133133
if (new_value != old_value) {
134134
length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
@@ -141,7 +141,7 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
141141
new_value, old_value,
142142
from_kuid(&init_user_ns, audit_get_loginuid(current)),
143143
audit_get_sessionid(current));
144-
set_enforcing(&selinux_state, new_value);
144+
enforcing_set(&selinux_state, new_value);
145145
if (new_value)
146146
avc_ss_reset(0);
147147
selnl_notify_setenforce(new_value);

security/selinux/ss/services.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ static int security_validtrans_handle_fail(struct selinux_state *state,
752752
kfree(n);
753753
kfree(t);
754754

755-
if (!is_enforcing(state))
755+
if (!enforcing_enabled(state))
756756
return 0;
757757
return -EPERM;
758758
}
@@ -1596,7 +1596,7 @@ static int compute_sid_handle_invalid_context(
15961596
kfree(s);
15971597
kfree(t);
15981598
kfree(n);
1599-
if (!is_enforcing(state))
1599+
if (!enforcing_enabled(state))
16001600
return 0;
16011601
return -EACCES;
16021602
}
@@ -1907,7 +1907,7 @@ static inline int convert_context_handle_invalid_context(
19071907
char *s;
19081908
u32 len;
19091909

1910-
if (is_enforcing(state))
1910+
if (enforcing_enabled(state))
19111911
return -EINVAL;
19121912

19131913
if (!context_struct_to_string(policydb, context, &s, &len)) {

security/selinux/ss/status.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct page *selinux_kernel_status_page(struct selinux_state *state)
5656

5757
status->version = SELINUX_KERNEL_STATUS_VERSION;
5858
status->sequence = 0;
59-
status->enforcing = is_enforcing(state);
59+
status->enforcing = enforcing_enabled(state);
6060
/*
6161
* NOTE: the next policyload event shall set
6262
* a positive value on the status->policyload,

0 commit comments

Comments
 (0)