You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
Revert "Fix #27: bool on kernel is 4 bytes, while rust's is 1 byte. This causes the stack to be covered, triggering a ub."
This reverts commit 7c27c32861.
This commit is contained in:
@@ -25,13 +25,13 @@ pub fn get_kernel_su() -> Option<Version> {
|
||||
}
|
||||
|
||||
pub fn uid_granted_root(uid: i32) -> bool {
|
||||
let mut granted = 0;
|
||||
unsafe { prctl(KERNEL_SU_OPTION, CMD_UID_GRANTED_ROOT, uid, &mut granted as *mut i32) };
|
||||
granted == 1
|
||||
let mut granted = false;
|
||||
unsafe { prctl(KERNEL_SU_OPTION, CMD_UID_GRANTED_ROOT, uid, &mut granted as *mut bool) };
|
||||
granted
|
||||
}
|
||||
|
||||
pub fn uid_should_umount(uid: i32) -> bool {
|
||||
let mut umount = 0;
|
||||
unsafe { prctl(KERNEL_SU_OPTION, CMD_UID_SHOULD_UMOUNT, uid, &mut umount as *mut i32) };
|
||||
umount == 1
|
||||
let mut umount = false;
|
||||
unsafe { prctl(KERNEL_SU_OPTION, CMD_UID_SHOULD_UMOUNT, uid, &mut umount as *mut bool) };
|
||||
umount
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user