mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH mmotm 1/3] userns: remove unneeded extra argument in selinux's task_has_capability
@ 2011-03-03  2:56 Serge E. Hallyn
  2011-03-03  2:57 ` [PATCH mmotm 2/3] userns: don't define init_user_ns in ipc_namespace.h Serge E. Hallyn
  2011-03-03  2:58 ` [PATCH mmotm 3/3] userns: make has_capability* into real functions Serge E. Hallyn
  0 siblings, 2 replies; 3+ messages in thread
From: Serge E. Hallyn @ 2011-03-03  2:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Stephen Smalley, Nathan Lynch, lkml, serge.hallyn

The user_namespace argument is not used by task_has_capability, so get
rid of it.  Note that it was spuriously added by the user namespace
patchset, so we're just cleaning up our own mess.

Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
---
 security/selinux/hooks.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: linux-2.6/security/selinux/hooks.c
===================================================================
--- linux-2.6.orig/security/selinux/hooks.c	2011-03-03 01:47:01.113745084 +0000
+++ linux-2.6/security/selinux/hooks.c	2011-03-03 01:47:48.017090039 +0000
@@ -1419,7 +1419,6 @@
 /* Check whether a task is allowed to use a capability. */
 static int task_has_capability(struct task_struct *tsk,
 			       const struct cred *cred,
-			       struct user_namespace *ns,
 			       int cap, int audit)
 {
 	struct common_audit_data ad;
@@ -1856,7 +1855,7 @@
 	if (rc)
 		return rc;
 
-	return task_has_capability(tsk, cred, ns, cap, audit);
+	return task_has_capability(tsk, cred, cap, audit);
 }
 
 static int selinux_quotactl(int cmds, int type, int id, struct super_block *sb)
@@ -2886,8 +2885,8 @@
 
 	case KDSKBENT:
 	case KDSKBSENT:
-		error = task_has_capability(current, cred, &init_user_ns,
-					CAP_SYS_TTY_CONFIG, SECURITY_CAP_AUDIT);
+		error = task_has_capability(current, cred, CAP_SYS_TTY_CONFIG,
+					SECURITY_CAP_AUDIT);
 		break;
 
 	/* default case assumes that the command will go

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-03  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-03  2:56 [PATCH mmotm 1/3] userns: remove unneeded extra argument in selinux's task_has_capability Serge E. Hallyn
2011-03-03  2:57 ` [PATCH mmotm 2/3] userns: don't define init_user_ns in ipc_namespace.h Serge E. Hallyn
2011-03-03  2:58 ` [PATCH mmotm 3/3] userns: make has_capability* into real functions Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®