You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature improvement request related to a problem? Please describe.
Looking up users using the current uzers crate fails when thin-edge.io is built using MUSL (instead of libc). MUSL builds do not use the NSS (Name Service Switch)
The lack of support for NSS results in some false negatives when looking up the linux user and/or group when creating files/folders which specific permissions.
Most notably, the installation fails in Fedora IoT as the OS makes use of an immutable file systems, but during installation of an RPM package, it creates a temporary passwd file in a temporary location to add the new users, resulting in thin-edge.io failing to lookup the mosquitto user if mosquitto is also being installed in the same installation transaction (see #2042 for more details).
Describe the solution you'd like
Use the binary id to check if a user/group exists, and to do a named lookup to either retrieve the user id or the group id by name. id is NSS enabled, so the lookups work correctly.
Lookup uid by name
id -u <USERNAME>
Lookup gid by name
id -g <USERNAME>
Describe alternatives you've considered
Switching back from MUSL to libc builds should also "fix" the issue, however this is not preferred as libc builds are still hard to manage as it would involve building individual binaries per OS target (e.g. Alpine requires musl builds, and other OS's not), and OS which generally use libc also require a specific version of libc which is difficult to control during the build process (as Rust does not provide an easy-to-use setting to control which version of libc the build should be linked again)
Additional context
There is a similar ticket which is also affected by the lack of NSS support in MUSL builds which results in mdns names not being resolvable: #2803 (comment)
And the discussion about the lack of NSS support for user/group lookups by the uzers crate.
Is your feature improvement request related to a problem? Please describe.
Looking up users using the current uzers crate fails when thin-edge.io is built using MUSL (instead of libc). MUSL builds do not use the NSS (Name Service Switch)
The lack of support for NSS results in some false negatives when looking up the linux user and/or group when creating files/folders which specific permissions.
Most notably, the installation fails in Fedora IoT as the OS makes use of an immutable file systems, but during installation of an RPM package, it creates a temporary passwd file in a temporary location to add the new users, resulting in thin-edge.io failing to lookup the
mosquitto
user if mosquitto is also being installed in the same installation transaction (see #2042 for more details).Describe the solution you'd like
Use the binary
id
to check if a user/group exists, and to do a named lookup to either retrieve the user id or the group id by name.id
is NSS enabled, so the lookups work correctly.Lookup uid by name
Lookup gid by name
Describe alternatives you've considered
Switching back from MUSL to libc builds should also "fix" the issue, however this is not preferred as libc builds are still hard to manage as it would involve building individual binaries per OS target (e.g. Alpine requires musl builds, and other OS's not), and OS which generally use libc also require a specific version of libc which is difficult to control during the build process (as Rust does not provide an easy-to-use setting to control which version of libc the build should be linked again)
Additional context
There is a similar ticket which is also affected by the lack of NSS support in MUSL builds which results in mdns names not being resolvable: #2803 (comment)
And the discussion about the lack of NSS support for user/group lookups by the uzers crate.
The text was updated successfully, but these errors were encountered: