-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
bug: User and group names not displayed with MUSL build #541
Comments
eza's using uzers, a derivative of users which is what exa was using. Doesn't look like it's changed much since I last poked at it. It's just calling I note you have rather high user and group ids - are they identified by anything more complex than just |
@Freaky I'm...not sure. It's on a NASA supercomputer cluster, so it's possible things are more complex. Indeed, if I look, my name is not in But, I used the power of ChatGPT to make a C code that uses #include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
#include <string.h>
int main(int argc, char *argv[]) {
if (argc != 2) {
fprintf(stderr, "Usage: %s <UID>\n", argv[0]);
return 1;
}
// Convert the user input (UID) to an integer
uid_t uid = atoi(argv[1]);
struct passwd pwd;
struct passwd *result;
char buffer[1024]; // A buffer to store the user information
// Call getpwuid_r to retrieve the user information
if (getpwuid_r(uid, &pwd, buffer, sizeof(buffer), &result) == 0) {
if (result != NULL) {
printf("User Information:\n");
printf("Username: %s\n", pwd.pw_name);
printf("User ID: %d\n", pwd.pw_uid);
printf("Group ID: %d\n", pwd.pw_gid);
printf("Home directory: %s\n", pwd.pw_dir);
printf("Shell: %s\n", pwd.pw_shell);
} else {
fprintf(stderr, "User with UID %d not found.\n", uid);
return 1;
}
} else {
perror("getpwuid_r");
return 1;
}
return 0;
} and when I run it:
So, it looks like |
Also, I asked ChatGPT about getting the group name, it added a call to |
|
I’ve seen that maybe you need the musl to also be installed for that to work, could you try installing it on your computer and see if it works? |
I'll try it out next week when I'm on the cluster again. Never tried building |
Is there any progress with this issue? Alternatively, is it possible to add CentOS build to the list of artefacts, something that would use glibc and run on older versions of linux? |
I'd forgotten all about this as my job got...busy. I was never able to build/install |
That said, can still confirm I see this with eza musl v0.17.1 |
I think mixing musl and glibc with PAM does not work. If the system PAM binaries and eza use the same "type", it should work. I don't have a musl system with PAM to test this hypothesis, does anyone use Alpine Linux and PAM with @j-xella is right, if the binaries were build on an older glibc, they could work on CentOS 7, which is still supported for a couple months. It's easy to build your own version, just install https://rustup.rs, get a release tarball and run |
I poked around a bit in context of rustadopt/uzers-rs#20 and can confirm that a MUSL build of uzers fails to retrieve SSS usernames. The core of the matter seems to be that retrieving information from SSSD requires NSS plugins which GLIBC sideloads after consulting As I said in the uzers issue I see two options, either building the SSS support into uzers which doesn't seem like a feasible thing, though, or avoiding MUSL builds when SSS is a requirement. |
Very often, the reason users have to use MUSL build is because they are stuck with old versions of Linux, where installed glibc is too old for the glibc version of eza. For those users, another solution could be an eza build for centOS. My understanding is those builds use older version of glibc. Is it very difficult to add CentOS artefact to the list of artefacts produced for every eza release? Wezterm does something similar. |
How hard is it to produce them? If we can automate it for free somehow that's great, if someone wants to try and figure out some solution, that's welcome. It should just seek to avoid creating more work for maintainers. |
Boilerplate:
and the OS is SLES 15SP4.
I am seeing an issue with
eza
that I also see inlsd
(see lsd-rs/lsd#374) and I saw in the past. I'm not a rust expert, but I'm guessing some underlying crate is the issue? 🤷🏼To wit, if I use plain
ls
:I see
mathomp4
andg0620
as I'd expect. Now if I use a GNUeza
:Okay. Now MUSL
eza
:MUSL
eza
is showing the numeric UID and GID, but not the "human-readable" version. Now, it's possible GNU has the wrong behavior (maybe I'm missing flags?) but in any case, the GNU and MUSL builds have different behavior.The text was updated successfully, but these errors were encountered: