Use fstrings to simplify setid

This commit is contained in:
Anthony Wang 2023-05-29 00:09:16 +00:00
parent 6b4e580c40
commit a03e2b4a34
Signed by: a
GPG key ID: 42A5B952E6DD8D38

5
setid
View file

@ -6,10 +6,7 @@
ids = ''
for uid in range(1000, 2000):
start = (uid - 999) * 10**5
num = 65536 # Allocate 65536 UIDs
ids += str(uid) + ':' + str(start) + ':' + str(num) + '\n'
ids += f'{uid}:{(uid - 999) * 10**5}:{65536}\n'
# Save to system files
with open('/etc/subuid', 'w') as f: