spiegel_podman/pkg/util
Giuseppe Scrivano 7a11ed5a77
libpod: fix --userns=keep-id with big UIDs
when creating a keep-id namespace, we split the original user
namespace in:

inner ns | outer ns  | size:
0        | 1         | ID
ID       | 0         | 1
ID+1     | ID+1      | availableIds - ID

When the user ID is bigger than the number of available
subuids/subgids we fail to create the user namespace because the first
slice is bigger than the available number of IDs and the third one has
a negative size.

Fix it by not using more than the available number of IDs in the first
slice and creating the third one only if there are other IDs left.

When the user ID is bigger than the number of additional IDs, there
will be a gap between the two mappings so the IDs between the maximum
additional ID and the user ID won't be present inside of the
namespace.

Closes: https://github.com/containers/libpod/issues/4838

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-10 22:33:30 +01:00
..
mountOpts.go mount: add new options nocopyup|copyup for tmpfs 2019-11-07 18:24:02 +01:00
utils.go libpod: fix --userns=keep-id with big UIDs 2020-01-10 22:33:30 +01:00
utils_darwin.go libpod removal from main (phase 2) 2019-06-27 07:56:24 -05:00
utils_linux.go golangci-lint phase 4 2019-07-22 15:44:04 -05:00
utils_supported.go Return empty runtime directory if we're not rootless 2019-12-07 14:18:55 +00:00
utils_test.go Add ONBUILD support to --change 2019-12-05 15:11:40 -05:00
utils_unsupported.go Move the HostConfig portion of Inspect inside libpod 2019-07-17 16:48:38 -04:00
utils_windows.go Use GetRuntimeDir to setup auth.json for login 2019-08-12 14:11:53 -04:00