On Sat, Nov 29, 2008 at 1:44 PM, SanjayKumar J <[EMAIL PROTECTED]> wrote:
> [ 2151451 ] cgconfigparser has permission bug
>
> The Patch  checks for admin permission is equal to root if not goes to
> error message part.
>
> Signed-off-by: SanjayKumar J <[EMAIL PROTECTED]>
>
> Index: config.c
> ===================================================================
> --- config.c    (revision 225)
> +++ config.c    (working copy)
> @@ -237,7 +237,7 @@
>
>                        error = getpwnam_r(value, pw, buffer, 
> CGROUP_BUFFER_LEN,
>                                                                &pw_buffer);
> -                       if (error) {
> +                       if (error || pw->pw_uid != 0) {

Hmm. this does not seem advisable. Suppose we want to give admin
rights to some other user? I am not sure if we should proceed this
way.

Thanks
Dhaval

>                                free(pw);
>                                goto admin_error;
>                        }
> @@ -258,7 +258,7 @@
>                        error = getgrnam_r(value, group, buffer,
>                                        CGROUP_BUFFER_LEN, &group_buffer);
>
> -                       if (error) {
> +                       if (error || group->gr_gid != 0) {
>                                free(group);
>                                goto admin_error;
>                        }
>


-- 

Mae West  - "I like restraint, if it doesn't go too far."

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to