1. 24 11月, 2015 1 次提交
  2. 23 11月, 2015 4 次提交
  3. 21 11月, 2015 2 次提交
    • J
      storage: Change virStorageBackendVolOpen to use virFileOpenAs · 5e3ad0b7
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1282288
      
      Rather than using just open on the path, allow for the possibility that
      the path to be opened resides on an NFS root-squash target and was created
      under a different uid/gid.
      
      Without using virFileOpenAs an attempt to get the volume size data may fail
      if the current user doesn't have permissions to read the volume, such as
      would be the case if mode wasn't supplied in the volume XML and the default
      VIR_STORAGE_DEFAULT_VOL_PERM_MODE (e.g. 0600) was used. Under this scenario
      the owner/group is not root:root, thus this path run under root would fail
      to open/read the volume.
      
      NB: The virFileOpenAs code using OPEN_FORK will only work when the failure
      is not EACESS/EPERM and the path resolves to a shared file system.
      5e3ad0b7
    • J
      storage: Really fix setting mode for backend exec in NFS root-squash env · ce6506b0
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1282288
      
      Although commit id '77346f27' resolves part of the problem regarding creating
      a qemu-img image in an NFS root-squash environment, it really didn't fix the
      entire problem. Unfortunately it only masked the problem. It seems qemu-img
      must open/create the image using 0644, which if used by target.perms would
      result in the chmod not being called since the mode desired and set match.
      
      Although qemu-img could conceivably ignore the mode when creating, libvirt
      has more knowledge of the environment and can make the adjustment to the
      mode far more easily by using virFileOpenAs with VIR_FILE_OPEN_FORCE_MODE.
      If that's successful, then we know on return the file will have the right
      owner and mode, so we can declare success
      ce6506b0
  4. 20 11月, 2015 5 次提交
  5. 19 11月, 2015 25 次提交
  6. 18 11月, 2015 3 次提交
    • R
      virSetUIDGID: Don't leak supplementary groups · 867f34a6
      Richard Weinberger 提交于
      The LXC driver uses virSetUIDGID() to become UID/GID 0.
      It passes an empty groups list to virSetUIDGID()
      to get rid of all supplementary groups from the host side.
      But virSetUIDGID() calls setgroups() only if the supplied list
      is larger than 0.
      This leads to a container root with unrelated supplementary groups.
      In most cases this issue is unoticed as libvirtd runs as UID/GID 0
      without any supplementary groups.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      867f34a6
    • R
      lxc: Bind mount container TTYs · 370707a7
      Richard Weinberger 提交于
      Instead of creating symlinks, bind mount the devices to
      /dev/pts/XY.
      Using bind mounts it is no longer needed to add pts devices
      to files like /etc/securetty.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      370707a7
    • R
      lxc: Don't make container's TTY a controlling TTY · ea542455
      Richard Weinberger 提交于
      Userspace does not expect that the initial console
      is a controlling TTY. systemd can deal with that, others not.
      On sysv init distros getty will fail to spawn a controlling on
      /dev/console or /dev/tty1. Which will cause to whole container
      to reboot upon ctrl-c.
      
      This patch changes the behavior of libvirt to match the kernel
      behavior where the initial TTY is also not controlling.
      
      The only user visible change should be that a container with
      bash as PID 1 would complain. But this matches exactly the kernel
      be behavior with init=/bin/bash.
      To get a controlling TTY for bash just run "setsid /bin/bash".
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      ea542455