summaryrefslogtreecommitdiff
path: root/kernel/user.c
diff options
context:
space:
mode:
authorFelix Blyakher <felixb@sgi.com>2009-03-06 17:06:44 -0600
committerFelix Blyakher <felixb@sgi.com>2009-03-06 17:06:44 -0600
commit47d1ff6e1a24c0126cd0243b1d6d0a3ffbd7a026 (patch)
treeb53cd3df68e3a199f6764c619c1a5092d27547e2 /kernel/user.c
parentb79631330a653f568a2ac4eb4a32474c80e3fe77 (diff)
parent559595a985e106d2fa9f0c79b7f5805453fed593 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/user.c b/kernel/user.c
index 3551ac742395..6a9b696128c8 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -362,6 +362,24 @@ static void free_user(struct user_struct *up, unsigned long flags)
#endif
+#if defined(CONFIG_RT_GROUP_SCHED) && defined(CONFIG_USER_SCHED)
+/*
+ * We need to check if a setuid can take place. This function should be called
+ * before successfully completing the setuid.
+ */
+int task_can_switch_user(struct user_struct *up, struct task_struct *tsk)
+{
+
+ return sched_rt_can_attach(up->tg, tsk);
+
+}
+#else
+int task_can_switch_user(struct user_struct *up, struct task_struct *tsk)
+{
+ return 1;
+}
+#endif
+
/*
* Locate the user_struct for the passed UID. If found, take a ref on it. The
* caller must undo that ref with free_uid().