[lxc-devel] [lxc/lxc] 9a7c2a: chown_mapped_root: don't try chgrp if we don't own...

GitHub noreply at github.com
Thu Jul 3 19:19:48 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 9a7c2aba4667c845d5518f6eba633417753e97d9
      https://github.com/lxc/lxc/commit/9a7c2aba4667c845d5518f6eba633417753e97d9
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-07-03 (Thu, 03 Jul 2014)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  chown_mapped_root: don't try chgrp if we don't own the file

New kernels require that to have privilege over a file, your
userns must have the old and new groups mapped into your userns.
So if a file is owned by our uid but another groupid, then we
have to chgrp the file to our primary group before we can try
(in a new user namespace) to chgrp the file to a group id in the
namespace.

But in some cases (when cloning) the file may already be mapped
into the container.  Now we cannot chgrp the file to our own
primary group - and we don't have to.

So detect that case.  Only try to chgrp the file to our primary
group if the file is owned by our euid (i.e. not by the container)
and the owning group is not already mapped into the container by
default.

With this patch, I'm again able to both create and clone containers
with no errors again.

Reported-by: S.Çağlar Onur <caglar at 10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>


  Commit: d4ef230cc9b86343b1f69d5e23711f3626305873
      https://github.com/lxc/lxc/commit/d4ef230cc9b86343b1f69d5e23711f3626305873
  Author: Rodrigo Vaz <rodrigo at heroku.com>
  Date:   2014-07-03 (Thu, 03 Jul 2014)

  Changed paths:
    M src/lxc/lxc_start.c
    M src/lxc/lxccontainer.c

  Log Message:
  -----------
  make the container exit code propagate to lxc-start exit code when appropriate

Signed-off-by: Rodrigo Sampaio Vaz <rodrigo at heroku.com>
Acked-by: Serge Hallyn <serge.hallyn at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/6e39e4cbff5d...d4ef230cc9b8


More information about the lxc-devel mailing list