From 1303f869eb553749cb233beb4955adfc700175fa Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 15:37:34 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index fa698029..8eea7794 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -98,17 +98,13 @@ def copy_archive(src_repo_path, dst_repo_path, entry): unshare.unshare(unshare.CLONE_NEWNS | unshare.CLONE_NEWUSER) with open('/proc/self/setgroups', 'w') as setgroups: setgroups.write('deny') - # with open('/proc/self/uid_map', 'w') as uid_map: - # uid_map.write(f'0 {uid} 1') - # with open('/proc/self/gid_map', 'w') as gid_map: - # gid_map.write(f'0 {gid} 1') + with open('/proc/self/uid_map', 'w') as uid_map: + uid_map.write(f'0 0 4294967295') + with open('/proc/self/gid_map', 'w') as gid_map: + gid_map.write(f'0 0 4294967295') pyprctl.cap_permitted.sys_admin = True pyprctl.cap_inheritable.sys_admin = True pyprctl.cap_ambient.sys_admin = True - with open('/proc/self/uid_map', 'w') as uid_map: - uid_map.write(f'0 0 1\n{uid} {uid} 1') - with open('/proc/self/gid_map', 'w') as gid_map: - gid_map.write(f'0 0 1\n{gid} {gid} 1') subprocess.run(['mount', '--make-rprivate', '/'], check=True) chroot = pathlib.Path(tmpdir) / 'chroot' upper = pathlib.Path(tmpdir) / 'upper' -- cgit v1.2.3