Skip to content
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

fix bugs on android armv7, because pw.pw_passwd.is_null() #1824

Merged
merged 1 commit into from Sep 24, 2022

Conversation

ClarkGuan
Copy link

crash on my Android phone because pw.pw_passwd == NULL

@rtzoeller
Copy link
Collaborator

How are you testing these changes - something like Termux? I'd like to see if I can reproduce this on my end.

Thanks!

@ClarkGuan
Copy link
Author

@rtzoeller use adb which in Android SDK like below:

$ adb push <path-to-exec> /data/local/tmp
$ adb shell /data/local/tmp/<exec-file>

Rust code:

use nix::unistd::{self, User};

fn main() {
    let user = User::from_uid(unistd::getuid())
        .expect("getpwuid_r()")
        .expect("option");
    println!("{:?}", user);
}

Crash also happened on aarch64 android platform.

@rtzoeller
Copy link
Collaborator

Thanks! Confirmed this reproduces for me.

Can you add an entry to the CHANGELOG.md file under the Fixed section, squashed into the current commit?

@rtzoeller
Copy link
Collaborator

@ClarkGuan can you squash the current two commits into a single commit?

@ClarkGuan
Copy link
Author

@rtzoeller OK.

Copy link
Collaborator

@rtzoeller rtzoeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors bors bot merged commit 7aaf808 into nix-rust:master Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants