[systemd-devel] [PATCH] Set cgroup path to uid for user sessions.

Lennart Poettering lennart at poettering.net
Fri Mar 22 16:11:39 PDT 2013


On Tue, 19.03.13 21:34, Auke Kok (auke-jan.h.kok at intel.com) wrote:

> Without this patch, I'm seeing cgroup paths for user sessions with
> both the user name, and the uid created, which can't be intended.
> 
> Spotted through user-session-units use.

Hmm, I am missing something here: where do we generate a cgroup path
with the uid currently? It's all use rname for the cgroup name right,
now, no? What am I missing?

> ---
>  src/login/logind-user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/login/logind-user.c b/src/login/logind-user.c
> index 411215a..8a91c80 100644
> --- a/src/login/logind-user.c
> +++ b/src/login/logind-user.c
> @@ -315,7 +315,7 @@ static int user_create_cgroup(User *u) {
>          assert(u);
>  
>          if (!u->cgroup_path) {
> -                if (asprintf(&p, "%s/%s", u->manager->cgroup_path, u->name) < 0)
> +                if (asprintf(&p, "%s/%lu", u->manager->cgroup_path, (unsigned long)u->uid) < 0)
>                          return log_oom();
>          } else
>                  p = u->cgroup_path;


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list