You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Migrate magiskinit selinux.cpp to Rust
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::{FsPath, LibcReturn};
|
||||
use crate::{FsPath, LibcReturn, Utf8CStr};
|
||||
use libc::c_ulong;
|
||||
use std::ptr;
|
||||
|
||||
@@ -29,6 +29,19 @@ impl FsPath {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remount_with_data(&self, data: &Utf8CStr) -> std::io::Result<()> {
|
||||
unsafe {
|
||||
libc::mount(
|
||||
ptr::null(),
|
||||
self.as_ptr(),
|
||||
ptr::null(),
|
||||
libc::MS_REMOUNT,
|
||||
data.as_ptr().cast(),
|
||||
)
|
||||
.as_os_err()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn move_mount_to(&self, path: &FsPath) -> std::io::Result<()> {
|
||||
unsafe {
|
||||
libc::mount(
|
||||
|
||||
Reference in New Issue
Block a user