From 82da13295e93983aaf2fe88766fa82243aa265aa Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 15:33:51 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'hosts/vidhar/borg') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index 9ced3a57..66846394 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -96,19 +96,19 @@ def copy_archive(src_repo_path, dst_repo_path, entry): # print('unshare/chroot', file=stderr) uid, gid = os.getuid(), os.getgid() 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/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') 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'{uid} {uid} 1') - with open('/proc/self/gid_map', 'w') as gid_map: - gid_map.write(f'{gid} {gid} 1') + # with open('/proc/self/uid_map', 'w') as uid_map: + # uid_map.write(f'{uid} {uid} 1') + # with open('/proc/self/gid_map', 'w') as gid_map: + # gid_map.write(f'{gid} {gid} 1') subprocess.run(['mount', '--make-rprivate', '/'], check=True) chroot = pathlib.Path(tmpdir) / 'chroot' upper = pathlib.Path(tmpdir) / 'upper' -- cgit v1.2.3