mirror of
https://github.com/namecoin/ncdns-repro
synced 2024-11-13 19:12:01 +00:00
Cirrus: Add root to subuid/subgid list
Fixes https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/issues/40298
This commit is contained in:
parent
6c02b0910f
commit
8f25d59249
22
tools/add-root-subids.py
Executable file
22
tools/add-root-subids.py
Executable 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")
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user