1. 03 Dec, 2015 8 commits
  2. 20 Nov, 2015 1 commit
  3. 18 Nov, 2015 4 commits
  4. 17 Nov, 2015 14 commits
  5. 12 Nov, 2015 2 commits
  6. 10 Nov, 2015 2 commits
  7. 09 Nov, 2015 2 commits
  8. 07 Nov, 2015 1 commit
  9. 06 Nov, 2015 6 commits
    • define PR_SET_MM_MAP & friends if necessary · 8d2ede58
      Tycho Andersen authored
      PR_SET_MM_MAP only went in to the kernel at 3.18 (or 3.19), so we need to
      define these for kernels before then. If there was an error, the code
      simply logs the failure and continues on.
      
      Also, we can drop the PR_SET_MM_otherstuff contstants since those were
      dropped in 93525c00.
      Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • c/r: don't require a veth link to c/r · c1fd648d
      Tycho Andersen authored
      veths can be unconnected in the container's config, and we should handle
      this case.
      Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
      Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • use PR_SET_MM_MAP instead of PR_SET_MM · 93525c00
      Tycho Andersen authored
      PR_SET_MM_MAP can be called as non-root, which we are in the unprivileged
      (or nested) case.
      
      Also, let's not do the strcpy() for the new cmdline until after we're sure
      the prctl succeeded. This means that even if it does fail, we won't
      mutilate the command line like we did before, it just won't be as pretty.
      
      v2: remember to chop off bits of the string that are too long
      Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • Fix calculations in clone_update_unexp_hooks() · d546aa0e
      Christian Brauner authored
      Changes v3:
      (1) Fix typo (q --> p).
      
      (1) This commit fixes the calculations when updating paths in lxc.hooks.*
          entries. We now also update conf->unexpandend_alloced which hasn't been
      done prior to this commit.
      
      (2) Also we use the stricter check:
      
          	if (p >= lend)
          		continue;
      
          This should deal better with invalid config files.
      
      (3) Insert some spaces between operators to increase readability.
      
      (4) Use gotos to simplify function and increase readability.
      Signed-off-by: 's avatarChristian Brauner <christianvanbrauner@gmail.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • Update absolute paths for overlay and aufs mounts · 030ce9a9
      Christian Brauner authored
      When using overlay and aufs mounts with lxc.mount.entry users have to specify
      absolute paths for upperdir and workdir which will then get created
      automatically by mount_entry_create_overlay_dirs() and
      mount_entry_create_aufs_dirs() in conf.c. When we clone a container with
      overlay or aufs lxc.mount.entry entries we need to update these absolute paths.
      In order to do this we add the function update_ovl_paths() in
      lxccontainer.c. The function updates the mounts in two locations:
      
              1) lxc_conf->mount_list
      
      and
      
              2) lxc_conf->unexpanded_config (by calling clone_update_unexp_ovl_dir())
      
      If we were to only update 2) we would end up with wrong upperdir and workdir
      mounts as the absolute paths would still point to the container that serves as
      the base for the clone. If we were to only update 1) we would end up with wrong
      upperdir and workdir lxc.mount.entry entries in the clone's config as the
      absolute paths in upperdir and workdir would still point to the container that
      serves as the base for the clone. Updating both will get the job done.
      
      NOTE: This function does not sanitize paths apart from removing trailing
      slashes. (So when a user specifies //home//someone/// it will be cleaned to
      //home//someone. This is the minimal path cleansing which is also done by
      lxc_container_new().) But the mount_entry_create_overlay_dirs() and
      mount_entry_create_aufs_dirs() functions both try to be extremely strict about
      when to create upperdirs and workdirs. They will only accept sanitized paths,
      i.e. they require /home/someone. I think this is a (safety) virtue and we
      should consider sanitizing paths in general. In short: update_ovl_paths() does
      update all absolute paths to the new container but
      mount_entry_create_overlay_dirs() and mount_entry_create_aufs_dirs() will still
      refuse to create upperdir and workdir when the updated path is unclean. This
      happens easily when e.g. a user calls lxc-clone -o OLD -n NEW -P
      //home//chb///.
      Signed-off-by: 's avatarChristian Brauner <christianvanbrauner@gmail.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
    • Add clone_update_unexp_ovl_paths() function · 329b3625
      Christian Brauner authored
      This functions updates absolute paths for overlay upper- and workdirs so users
      can simply clone and start new containers without worrying about absolute paths
      in lxc.mount.entry overlay entries.
      Signed-off-by: 's avatarChristian Brauner <christianvanbrauner@gmail.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>