Skip to content

Commit 24e8f6f

Browse files
authored
Merge pull request #3435 from AkihiroSuda/fix-moby-49810
rootless: allow UID >= 524288
2 parents b0daf60 + 26b71ad commit 24e8f6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: pkg/cidata/cidata.TEMPLATE.d/boot/20-rootless-base.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ for f in /etc/subuid /etc/subgid; do
7171
# See userdbctl.
7272
# 1073741824 (1G) is just an arbitrary number.
7373
# 1073741825-1878982656 is left blank for additional accounts.
74-
grep -qw "${LIMA_CIDATA_USER}" $f || echo "${LIMA_CIDATA_USER}:524288:1073741824" >>$f
74+
subuid_begin=524288
75+
# https://github.com/moby/moby/issues/49810#issuecomment-2808108191
76+
[ "${LIMA_CIDATA_UID}" -ge "${subuid_begin}" ] && subuid_begin="$((LIMA_CIDATA_UID + 1))"
77+
grep -qw "${LIMA_CIDATA_USER}" $f || echo "${LIMA_CIDATA_USER}:${subuid_begin}:1073741824" >>$f
7578
done
7679

7780
# Start systemd session

0 commit comments

Comments
 (0)