-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils: fix creating default userns #1073
Conversation
fix creating the default user namespace when the GID on the host is different than the UID and there is not not already a mapping specified in the OCI configuration. Closes: containers#1072 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@@ -323,7 +323,7 @@ int copy_from_fd_to_fd (int src, int dst, int consume, libcrun_error_t *err); | |||
|
|||
int run_process (char **args, libcrun_error_t *err); | |||
|
|||
size_t format_default_id_mapping (char **ret, uid_t container_id, uid_t host_id, int is_uid); | |||
size_t format_default_id_mapping (char **ret, uid_t container_id, uid_t host_uid, uid_t host_id, int is_uid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be (..., uid_t host_uid, uid_t host_gid,...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
host_id
is either UID or GID, depending on the value of is_uid
. We need to differentiate since we use different files for the lookup (/etc/subuid
or /etc/subgid
)
@@ -1403,15 +1403,15 @@ getsubidrange (uid_t id, int is_uid, uint32_t *from, uint32_t *len) | |||
#define MIN(x, y) ((x) < (y) ? (x) : (y)) | |||
|
|||
size_t | |||
format_default_id_mapping (char **ret, uid_t container_id, uid_t host_id, int is_uid) | |||
format_default_id_mapping (char **ret, uid_t container_id, uid_t host_uid, uid_t host_id, int is_uid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be (..., uid_t host_uid, uid_t host_gid,...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhatdan is this resolved I think this has same explanation as the above one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
fix creating the default user namespace when the GID on the host is different than the UID and there is not not already a mapping specified in the OCI configuration.
Closes: #1072
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com