On Fri, Nov 5, 2010 at 2:56 PM, Ivana Hutarova Varekova
<[email protected]> wrote:
> From: Your Name <[email protected]>
>

Can we fix this :-)?

> This patch removes the permission change from control_group_create function
> It should be done only if the caller needs it not by default.
>

I am not convinced why we need this yet. (we need to give the same
permissions to the group at the very least). A simple use case would
help a lot.

> EXAMPLE:
> before the change:
> # ./tools/cgcreate -g devices:/test1
> # ll /cgroup/cpu3/test1
> total 0
> -rwxrwxr-x. 1 root root 0 2010-11-02 08:05 cgroup.procs
> -rwxrwxr-x. 1 root root 0 2010-11-02 08:05 devices.allow
> -rwxrwxr-x. 1 root root 0 2010-11-02 08:05 devices.deny
> -rwxrwxr-x. 1 root root 0 2010-11-02 08:05 devices.list
> -rwxrwxr-x. 1 root root 0 2010-11-02 08:05 notify_on_release
> -rwxrwxr-x. 1 root root 0 2010-11-02 08:05 tasks
> # ll /cgroup/cpu3/ | grep test1
> drwxrwxr-x. 2 root root 0 2010-11-02 08:05 test1
>
>
> after the change:
> # ./tools/cgcreate -g devices:/test2
> # ll /cgroup/cpu3/test2
> total 0
> -r--r--r--. 1 root root 0 2010-11-02 08:04 cgroup.procs
> --w-------. 1 root root 0 2010-11-02 08:04 devices.allow
> --w-------. 1 root root 0 2010-11-02 08:04 devices.deny
> -r--r--r--. 1 root root 0 2010-11-02 08:04 devices.list
> -rw-r--r--. 1 root root 0 2010-11-02 08:04 notify_on_release
> -rw-r--r--. 1 root root 0 2010-11-02 08:04 tasks
> # ll /cgroup/cpu3/ | grep test2
> drwxr-xr-x. 2 root root 0 2010-11-02 08:04 test2
>
>
> Signed-off-by: Ivana Hutarova Varekova<[email protected]>
> ---
>
>  0 files changed, 0 insertions(+), 0 deletions(-)
>

Can you please fix your scripts to get this right?

> diff --git a/src/api.c b/src/api.c
> index d8f6766..6e79db0 100644
> --- a/src/api.c
> +++ b/src/api.c
> @@ -124,7 +124,7 @@ static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t 
> owner, gid_t group)
>  {
>        int ret = 0;
>        const char *filename = fts->fts_path;
> -       cgroup_dbg("seeing file %s\n", filename);
> +       cgroup_dbg("chown: seeing file %s\n", filename);
>        switch (ent->fts_info) {
>        case FTS_ERR:
>                errno = ent->fts_errno;
> @@ -135,22 +135,11 @@ static int cg_chown_file(FTS *fts, FTSENT *ent, uid_t 
> owner, gid_t group)
>        case FTS_NS:
>        case FTS_DNR:
>        case FTS_DP:
> -               ret = chown(filename, owner, group);
> -               if (ret)
> -                       goto fail_chown;
> -               ret = chmod(filename, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
> -                                       S_IWGRP | S_IXGRP | S_IROTH | 
> S_IXOTH);
> -               break;
>        case FTS_F:
>        case FTS_DEFAULT:
>                ret = chown(filename, owner, group);
> -               if (ret)
> -                       goto fail_chown;
> -               ret = chmod(filename, S_IRUSR | S_IWUSR |  S_IRGRP |
> -                                               S_IWGRP | S_IROTH);
>                break;
>        }
> -fail_chown:
>        if (ret < 0) {
>                last_errno = errno;
>                ret = ECGOTHER;
> @@ -166,7 +155,7 @@ static int cg_chown_recursive(char **path, uid_t owner, 
> gid_t group)
>        int ret = 0;
>        FTS *fts;
>
> -       cgroup_dbg("path is %s\n", *path);
> +       cgroup_dbg("chown: path is %s\n", *path);
>        fts = fts_open(path, FTS_PHYSICAL | FTS_NOCHDIR |
>                                FTS_NOSTAT, NULL);
>        while (1) {
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> Libcg-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to