Cirrus: Add root to subuid/subgid list

Fixes
https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/issues/40298
This commit is contained in:
Jeremy Rand 2021-05-19 07:26:56 +00:00
parent 6c02b0910f
commit 8f25d59249
No known key found for this signature in database
GPG Key ID: FD7550C2EB800711
2 changed files with 25 additions and 0 deletions

22
tools/add-root-subids.py Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python3
def add_subid(baseid: str, filename: str):
mapid = 100000
countid = 65536
with open(filename, "r") as f:
for line in f:
line_baseid, line_mapid, line_countid = line.split(":")
line_mapid = int(line_mapid)
line_countid = int(line_countid)
if line_baseid == baseid:
return
mapid = max(mapid, line_mapid + line_countid)
with open(filename, "a") as f:
f.write(f"{baseid}:{mapid}:{countid}\n")
add_subid("root", "/etc/subuid")
add_subid("root", "/etc/subgid")

View File

@ -36,6 +36,9 @@ cat tools/rbm.local.conf.onetarget | sed "s/CHANNEL/$CHANNEL/g" | sed "s/ncdns-a
echo "Patching rbm..."
./tools/patch-tor-to-namecoin.sh
echo "Mapping subid's..."
./tools/add-root-subids.py
if [[ "$BUMP_DEPS" -eq 1 ]]; then
./tools/namecoin-bump-versions.sh
exit 0