-
Notifications
You must be signed in to change notification settings - Fork 2
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
Panicking when using passwd::get_entry_by_uid or group::get_entry_by_gid #3
Comments
It would be helpful to have a bit more information.
This works with the testdata I have but if you have a potentially valid file that this can't parse it would be good to add it to the testdata |
Nightly Rust. Not possible; this is a clean install of OS X El Capitan from yesterday. Have not done any modifications to accounts or groups beyond creating my user. They both panic.
|
|
Do you have any examples from /etc/passwd and/or /etc/group you can post? I don't use or have access to a mac though it would seem that it's possible that on OS X that not all fields are always present. Basically right now it is assuming that |
Actually do those files have comments in them? I don't account for comments so that could be a problem. |
I've just pushed 0.0.5 which should handle comments. Can you test to see if this solves your issues? |
Still panicking. Here's
And
|
Is it the same panic? It definitely looks like the comments would have caused problems so we're a bit further though I see two potential issues now. First is that there at negative values for uid/gid. I'll have to look more carefully about how to handle this. I'm using The second is that this crate won't use additional databases for pulling user information. It's limited to the passwd, group, and shadow file specifically. If, as the comment says, your users are in the "Open Directory" then You'll get None back and your It's likely that this library isn't what you want. You probably want to use something like |
Yes, the same panic. Where would I find references for those functions? Searching for them in the libc docs yields only libc::getenv. |
I'm a bit surprised that you'd get the same panic. Did you run It doesn't look like the rust |
I changed Cargo.toml to point to 0.0.5. |
I've pushed another fix ( |
Code is at aarzee/coreutils. Commenting out both of the relevant lines results in no panicking.
The text was updated successfully, but these errors were encountered: