summaryrefslogtreecommitdiff
path: root/hosts/vidhar/borg/copy.py
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vidhar/borg/copy.py')
-rwxr-xr-xhosts/vidhar/borg/copy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py
index 0b863094..cd63146d 100755
--- a/hosts/vidhar/borg/copy.py
+++ b/hosts/vidhar/borg/copy.py
@@ -21,6 +21,8 @@ from xdg import xdg_runtime_dir
21import pathlib 21import pathlib
22 22
23import unshare 23import unshare
24import pyprctl
25
24import signal 26import signal
25from time import sleep 27from time import sleep
26 28
@@ -86,6 +88,7 @@ def copy_archive(src_repo_path, dst_repo_path, entry):
86 # print('unshare/chroot', file=stderr) 88 # print('unshare/chroot', file=stderr)
87 unshare.unshare(unshare.CLONE_NEWUSER) 89 unshare.unshare(unshare.CLONE_NEWUSER)
88 unshare.unshare(unshare.CLONE_NEWNS) 90 unshare.unshare(unshare.CLONE_NEWNS)
91 pyprctl.cap_ambient_raise(pyprctl.SYS_ADMIN)
89 subprocess.run(['mount', '--make-rprivate', '/'], check=True) 92 subprocess.run(['mount', '--make-rprivate', '/'], check=True)
90 chroot = pathlib.Path(tmpdir) / 'chroot' 93 chroot = pathlib.Path(tmpdir) / 'chroot'
91 upper = pathlib.Path(tmpdir) / 'upper' 94 upper = pathlib.Path(tmpdir) / 'upper'