[ 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) {
                                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;
                        }

-------------------------------------------------------------------------
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