nix
nix copied to clipboard
fix bugs on android armv7, because `pw.pw_passwd.is_null()`
crash on my Android phone because pw.pw_passwd == NULL
How are you testing these changes - something like Termux? I'd like to see if I can reproduce this on my end.
Thanks!
@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.
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?
@ClarkGuan can you squash the current two commits into a single commit?
@rtzoeller OK.
Build succeeded:
- Android aarch64
- Android arm
- Android armv7
- Android i686
- Android x86_64
- DragonFly BSD x86_64
- FreeBSD 12 amd64 & i686
- FreeBSD 14 amd64 & i686
- Fuchsia x86_64
- Haiku x86_64
- Illumos
- iOS aarch64
- iOS x86_64
- Linux aarch64
- Linux arm gnueabi
- Linux arm-musleabi
- Linux armv7 gnueabihf
- Linux armv7 uclibceabihf
- Linux i686
- Linux i686 musl
- Linux MIPS
- Linux MIPS64
- Linux MIPS64 el
- Linux mipsel
- Linux powerpc
- Linux powerpc64
- Linux powerpc64le
- Linux s390x
- Linux x32
- Linux x86_64
- Linux x86_64 musl
- macOS aarch64
- macOS x86_64
- Minver
- NetBSD x86_64
- OpenBSD x86_64
- Redox x86_64
- Rust Formatter
- Rust Stable