From 4d6e8a8290e79bfa8c24d4e477e03bbb00a3eacf Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 16:53:21 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'hosts/vidhar/borg') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index 5617635b..8cfcbd56 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -102,12 +102,12 @@ def copy_archive(src_repo_path, dst_repo_path, entry): pyprctl.cap_effective.add(*(ps_effective | ps_ambient)) pyprctl.cap_inheritable.add(*ps_ambient) pyprctl.cap_ambient.add(*ps_ambient) - # 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') subprocess.run(['mount', '--make-rprivate', '/'], check=True) chroot = pathlib.Path(tmpdir) / 'chroot' upper = pathlib.Path(tmpdir) / 'upper' -- cgit v1.2.3