diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-04 11:14:47 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-04 11:14:47 +0100 |
commit | a1be621dfacbef0fd374d8acd553d71e07bf29ac (patch) | |
tree | 32b0355454b43b1098b5e01dd699fd7281abf781 /kernel/user.c | |
parent | 3612fdf780e28b10323dd12d2b0f306c7ada4d4c (diff) | |
parent | fec6c6fec3e20637bee5d276fb61dd8b49a3f9cc (diff) | |
download | linux-a1be621dfacbef0fd374d8acd553d71e07bf29ac.tar.gz linux-a1be621dfacbef0fd374d8acd553d71e07bf29ac.tar.bz2 linux-a1be621dfacbef0fd374d8acd553d71e07bf29ac.zip |
Merge branch 'tracing/ftrace'; commit 'v2.6.29-rc7' into tracing/core
Diffstat (limited to 'kernel/user.c')
-rw-r--r-- | kernel/user.c | 18 |
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(). |