X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=kernel%2Fuser.c;h=6a9b696128c855f9ddacfc9e3a7a128141379e49;hb=22bdd4f599b87734b7fc8137f47e62c13ab27e93;hp=3551ac742395c40af9edeb7d94d0d0b936caba9b;hpb=29a0c5ce5d008f398346d644456d62ab300d5e10;p=linux-2.6-omap-h63xx.git diff --git a/kernel/user.c b/kernel/user.c index 3551ac74239..6a9b696128c 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().