aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2008-11-13 18:39:15 -0500
committerJames Morris <jmorris@namei.org>2008-11-13 18:39:15 -0500
commit15a2460ed0af7538ca8e6c610fe607a2cd9da142 (patch)
tree3611bc03e9c30fe0d11454f6966e6b0ca7f1dbd0 /security
parent1cdcbec1a3372c0c49c59d292e708fd07b509f18 (diff)
CRED: Constify the kernel_cap_t arguments to the capset LSM hooks
Constify the kernel_cap_t arguments to the capset LSM hooks. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security')
-rw-r--r--security/commoncap.c10
-rw-r--r--security/security.c12
-rw-r--r--security/selinux/hooks.c10
3 files changed, 18 insertions, 14 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index e3f36ef629fa..fb4e240720d8 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -118,8 +118,9 @@ static inline int cap_limit_ptraced_target(void)
118 118
119#endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */ 119#endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */
120 120
121int cap_capset_check (kernel_cap_t *effective, 121int cap_capset_check(const kernel_cap_t *effective,
122 kernel_cap_t *inheritable, kernel_cap_t *permitted) 122 const kernel_cap_t *inheritable,
123 const kernel_cap_t *permitted)
123{ 124{
124 if (cap_inh_is_capped() 125 if (cap_inh_is_capped()
125 && !cap_issubset(*inheritable, 126 && !cap_issubset(*inheritable,
@@ -150,8 +151,9 @@ int cap_capset_check (kernel_cap_t *effective,
150 return 0; 151 return 0;
151} 152}
152 153
153void cap_capset_set (kernel_cap_t *effective, 154void cap_capset_set(const kernel_cap_t *effective,
154 kernel_cap_t *inheritable, kernel_cap_t *permitted) 155 const kernel_cap_t *inheritable,
156 const kernel_cap_t *permitted)
155{ 157{
156 current->cap_effective = *effective; 158 current->cap_effective = *effective;
157 current->cap_inheritable = *inheritable; 159 current->cap_inheritable = *inheritable;
diff --git a/security/security.c b/security/security.c
index dca37381e2a7..81c956a12300 100644
--- a/security/security.c
+++ b/security/security.c
@@ -145,16 +145,16 @@ int security_capget(struct task_struct *target,
145 return security_ops->capget(target, effective, inheritable, permitted); 145 return security_ops->capget(target, effective, inheritable, permitted);
146} 146}
147 147
148int security_capset_check(kernel_cap_t *effective, 148int security_capset_check(const kernel_cap_t *effective,
149 kernel_cap_t *inheritable, 149 const kernel_cap_t *inheritable,
150 kernel_cap_t *permitted) 150 const kernel_cap_t *permitted)
151{ 151{
152 return security_ops->capset_check(effective, inheritable, permitted); 152 return security_ops->capset_check(effective, inheritable, permitted);
153} 153}
154 154
155void security_capset_set(kernel_cap_t *effective, 155void security_capset_set(const kernel_cap_t *effective,
156 kernel_cap_t *inheritable, 156 const kernel_cap_t *inheritable,
157 kernel_cap_t *permitted) 157 const kernel_cap_t *permitted)
158{ 158{
159 security_ops->capset_set(effective, inheritable, permitted); 159 security_ops->capset_set(effective, inheritable, permitted);
160} 160}
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index df9986940e9c..9f6da154cc82 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1790,8 +1790,9 @@ static int selinux_capget(struct task_struct *target, kernel_cap_t *effective,
1790 return secondary_ops->capget(target, effective, inheritable, permitted); 1790 return secondary_ops->capget(target, effective, inheritable, permitted);
1791} 1791}
1792 1792
1793static int selinux_capset_check(kernel_cap_t *effective, 1793static int selinux_capset_check(const kernel_cap_t *effective,
1794 kernel_cap_t *inheritable, kernel_cap_t *permitted) 1794 const kernel_cap_t *inheritable,
1795 const kernel_cap_t *permitted)
1795{ 1796{
1796 int error; 1797 int error;
1797 1798
@@ -1802,8 +1803,9 @@ static int selinux_capset_check(kernel_cap_t *effective,
1802 return task_has_perm(current, current, PROCESS__SETCAP); 1803 return task_has_perm(current, current, PROCESS__SETCAP);
1803} 1804}
1804 1805
1805static void selinux_capset_set(kernel_cap_t *effective, 1806static void selinux_capset_set(const kernel_cap_t *effective,
1806 kernel_cap_t *inheritable, kernel_cap_t *permitted) 1807 const kernel_cap_t *inheritable,
1808 const kernel_cap_t *permitted)
1807{ 1809{
1808 secondary_ops->capset_set(effective, inheritable, permitted); 1810 secondary_ops->capset_set(effective, inheritable, permitted);
1809} 1811}