Make the overlayfs mount point's owners and modes match the underlay.

This fixes sudo in the chroot.
This commit is contained in:
Andrew Hamilton 2016-02-10 22:33:49 +00:00
parent 1939d1eda2
commit 964243ffb8
3 changed files with 6 additions and 1 deletions

View file

@ -20,6 +20,9 @@ class OverlayfsMount():
subprocess.check_call(["sudo", "mount", "-t", "overlayfs", "-o",
option_string, "overlayfs", self.mount_point],
stderr=subprocess.PIPE)
for command in ["chmod", "chown"]:
subprocess.check_call(["sudo", command, "--reference", lower_dir,
mount_point])
def __repr__(self):
return "<OverlayfsMount:%r over %r>" % (self.mount_point,