diff --git a/native/src/base/cstr.rs b/native/src/base/cstr.rs index 898057469..bbd036077 100644 --- a/native/src/base/cstr.rs +++ b/native/src/base/cstr.rs @@ -11,7 +11,7 @@ use std::str::Utf8Error; use std::{fmt, mem, slice, str}; use thiserror::Error; -use crate::{FsPath, FsPathMnt, slice_from_ptr_mut}; +use crate::slice_from_ptr_mut; // Utf8CStr types are UTF-8 validated and null terminated strings. // // Several Utf8CStr types: @@ -609,22 +609,6 @@ impl_cstr_buf_write!( (Utf8CString,) ); -// impl> FsPath for T {} -// impl> FsPathMnt for T {} -macro_rules! impl_fs_path { - ($( ($t:ty, $($g:tt)*) )*) => {$( - impl<$($g)*> FsPath for $t {} - impl<$($g)*> FsPathMnt for $t {} - )*} -} - -impl_fs_path!( - (&Utf8CStr,) - (Utf8CStrBufRef<'_>,) - (Utf8CStrBufArr, const N: usize) - (Utf8CString,) -); - #[macro_export] macro_rules! cstr { ($str:expr) => {{ diff --git a/native/src/base/cxx_extern.rs b/native/src/base/cxx_extern.rs index 86de3e302..8b4fae3fb 100644 --- a/native/src/base/cxx_extern.rs +++ b/native/src/base/cxx_extern.rs @@ -8,8 +8,8 @@ use libc::{c_char, mode_t}; use crate::files::map_file_at; pub(crate) use crate::xwrap::*; use crate::{ - CxxResultExt, Directory, FsPath, OsResultStatic, Utf8CStr, clone_attr, cstr, fclone_attr, - fd_path, map_fd, map_file, slice_from_ptr, + CxxResultExt, Directory, OsResultStatic, Utf8CStr, clone_attr, cstr, fclone_attr, fd_path, + map_fd, map_file, slice_from_ptr, }; pub(crate) fn fd_path_for_cxx(fd: RawFd, buf: &mut [u8]) -> isize { diff --git a/native/src/base/dir.rs b/native/src/base/dir.rs index 8ae91c896..10786db43 100644 --- a/native/src/base/dir.rs +++ b/native/src/base/dir.rs @@ -1,7 +1,7 @@ use crate::cxx_extern::readlinkat; use crate::{ - FileAttr, FsPath, FsPathBuilder, LibcReturn, OsError, OsResult, OsResultStatic, Utf8CStr, - Utf8CStrBuf, cstr, errno, fd_path, fd_set_attr, + FileAttr, FsPathBuilder, LibcReturn, OsError, OsResult, OsResultStatic, Utf8CStr, Utf8CStrBuf, + cstr, errno, fd_path, fd_set_attr, }; use libc::{EEXIST, O_CLOEXEC, O_CREAT, O_RDONLY, O_TRUNC, O_WRONLY, dirent, mode_t}; use std::fs::File; diff --git a/native/src/base/files.rs b/native/src/base/files.rs index 931163e2c..1758e9717 100644 --- a/native/src/base/files.rs +++ b/native/src/base/files.rs @@ -14,7 +14,6 @@ use std::ffi::CStr; use std::fmt::Display; use std::fs::File; use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write}; -use std::ops::Deref; use std::os::fd::{AsFd, BorrowedFd}; use std::os::unix::ffi::OsStrExt; use std::os::unix::io::{AsRawFd, FromRawFd, OwnedFd, RawFd}; @@ -187,27 +186,27 @@ impl FileAttr { const XATTR_NAME_SELINUX: &CStr = c"security.selinux"; -pub trait FsPath: Deref { - fn follow_link(&self) -> &FsPathFollow { - unsafe { mem::transmute(self.deref()) } +impl Utf8CStr { + pub fn follow_link(&self) -> &FsPathFollow { + unsafe { mem::transmute(self) } } - fn open(&self, flags: i32) -> OsResult { + pub fn open(&self, flags: i32) -> OsResult { Ok(File::from(open_fd(self, flags, 0)?)) } - fn create(&self, flags: i32, mode: mode_t) -> OsResult { + pub fn create(&self, flags: i32, mode: mode_t) -> OsResult { Ok(File::from(open_fd(self, O_CREAT | flags, mode)?)) } - fn exists(&self) -> bool { + pub fn exists(&self) -> bool { unsafe { let mut st: stat = mem::zeroed(); libc::lstat(self.as_ptr(), &mut st) == 0 } } - fn rename_to<'a>(&'a self, name: &'a Utf8CStr) -> OsResult<'a, ()> { + pub fn rename_to<'a>(&'a self, name: &'a Utf8CStr) -> OsResult<'a, ()> { unsafe { libc::rename(self.as_ptr(), name.as_ptr()).check_os_err( "rename", @@ -217,11 +216,11 @@ pub trait FsPath: Deref { } } - fn remove(&self) -> OsResult<()> { + pub fn remove(&self) -> OsResult<()> { unsafe { libc::remove(self.as_ptr()).check_os_err("remove", Some(self), None) } } - fn remove_all(&self) -> OsResultStatic<()> { + pub fn remove_all(&self) -> OsResultStatic<()> { let attr = self.get_attr()?; if attr.is_dir() { let mut dir = Directory::try_from(open_fd(self, O_RDONLY | O_CLOEXEC, 0)?)?; @@ -231,7 +230,7 @@ pub trait FsPath: Deref { } #[allow(clippy::unnecessary_cast)] - fn read_link(&self, buf: &mut dyn Utf8CStrBuf) -> OsResult<()> { + pub fn read_link(&self, buf: &mut dyn Utf8CStrBuf) -> OsResult<()> { buf.clear(); unsafe { let r = libc::readlink(self.as_ptr(), buf.as_mut_ptr(), buf.capacity() - 1) @@ -242,7 +241,7 @@ pub trait FsPath: Deref { Ok(()) } - fn mkdir(&self, mode: mode_t) -> OsResult<()> { + pub fn mkdir(&self, mode: mode_t) -> OsResult<()> { unsafe { if libc::mkdir(self.as_ptr(), mode) < 0 { if *errno() == EEXIST { @@ -255,7 +254,7 @@ pub trait FsPath: Deref { Ok(()) } - fn mkdirs(&self, mode: mode_t) -> OsResultStatic<()> { + pub fn mkdirs(&self, mode: mode_t) -> OsResultStatic<()> { if self.is_empty() { return Ok(()); } @@ -280,7 +279,7 @@ pub trait FsPath: Deref { } // Inspired by https://android.googlesource.com/platform/bionic/+/master/libc/bionic/realpath.cpp - fn realpath(&self, buf: &mut dyn Utf8CStrBuf) -> OsResult<()> { + pub fn realpath(&self, buf: &mut dyn Utf8CStrBuf) -> OsResult<()> { let fd = self.open(O_PATH | O_CLOEXEC)?; let mut st1: libc::stat; let mut st2: libc::stat; @@ -304,7 +303,7 @@ pub trait FsPath: Deref { Ok(()) } - fn get_attr(&self) -> OsResult { + pub fn get_attr(&self) -> OsResult { let mut attr = FileAttr::new(); unsafe { libc::lstat(self.as_ptr(), &mut attr.st).check_os_err("lstat", Some(self), None)?; @@ -315,7 +314,7 @@ pub trait FsPath: Deref { Ok(attr) } - fn set_attr<'a>(&'a self, attr: &'a FileAttr) -> OsResult<'a, ()> { + pub fn set_attr<'a>(&'a self, attr: &'a FileAttr) -> OsResult<'a, ()> { unsafe { if !attr.is_symlink() { libc::chmod(self.as_ptr(), (attr.st.st_mode & 0o777).as_()).check_os_err( @@ -338,7 +337,7 @@ pub trait FsPath: Deref { Ok(()) } - fn get_secontext(&self, con: &mut dyn Utf8CStrBuf) -> OsResult<()> { + pub fn get_secontext(&self, con: &mut dyn Utf8CStrBuf) -> OsResult<()> { unsafe { let sz = libc::lgetxattr( self.as_ptr(), @@ -358,7 +357,7 @@ pub trait FsPath: Deref { Ok(()) } - fn set_secontext<'a>(&'a self, con: &'a Utf8CStr) -> OsResult<'a, ()> { + pub fn set_secontext<'a>(&'a self, con: &'a Utf8CStr) -> OsResult<'a, ()> { unsafe { libc::lsetxattr( self.as_ptr(), @@ -371,7 +370,7 @@ pub trait FsPath: Deref { } } - fn copy_to(&self, path: &Utf8CStr) -> OsResultStatic<()> { + pub fn copy_to(&self, path: &Utf8CStr) -> OsResultStatic<()> { let attr = self.get_attr()?; if attr.is_dir() { path.mkdir(0o777)?; @@ -401,7 +400,7 @@ pub trait FsPath: Deref { Ok(()) } - fn move_to(&self, path: &Utf8CStr) -> OsResultStatic<()> { + pub fn move_to(&self, path: &Utf8CStr) -> OsResultStatic<()> { if path.exists() { let attr = path.get_attr()?; if attr.is_dir() { @@ -416,7 +415,7 @@ pub trait FsPath: Deref { Ok(()) } - fn parent(&self, buf: &mut dyn Utf8CStrBuf) -> bool { + pub fn parent(&self, buf: &mut dyn Utf8CStrBuf) -> bool { buf.clear(); if let Some(parent) = Path::new(self.as_str()).parent() { let bytes = parent.as_os_str().as_bytes(); @@ -430,7 +429,7 @@ pub trait FsPath: Deref { } // ln self path - fn link_to(&self, path: &Utf8CStr) -> OsResultStatic<()> { + pub fn link_to(&self, path: &Utf8CStr) -> OsResultStatic<()> { let attr = self.get_attr()?; if attr.is_dir() { path.mkdir(0o777)?; @@ -451,7 +450,7 @@ pub trait FsPath: Deref { } // ln -s target self - fn create_symlink_to<'a>(&'a self, target: &'a Utf8CStr) -> OsResult<'a, ()> { + pub fn create_symlink_to<'a>(&'a self, target: &'a Utf8CStr) -> OsResult<'a, ()> { unsafe { libc::symlink(target.as_ptr(), self.as_ptr()).check_os_err( "symlink", @@ -461,21 +460,17 @@ pub trait FsPath: Deref { } } - fn mkfifo(&self, mode: mode_t) -> OsResult<()> { + pub fn mkfifo(&self, mode: mode_t) -> OsResult<()> { unsafe { libc::mkfifo(self.as_ptr(), mode).check_os_err("mkfifo", Some(self), None) } } } -impl FsPath for FsPathFollow { - fn follow_link(&self) -> &FsPathFollow { - self - } - - fn exists(&self) -> bool { +impl FsPathFollow { + pub fn exists(&self) -> bool { unsafe { libc::access(self.as_ptr(), F_OK) == 0 } } - fn get_attr(&self) -> OsResult { + pub fn get_attr(&self) -> OsResult { let mut attr = FileAttr::new(); unsafe { libc::stat(self.as_ptr(), &mut attr.st).check_os_err("stat", Some(self), None)?; @@ -486,7 +481,7 @@ impl FsPath for FsPathFollow { Ok(attr) } - fn set_attr<'a>(&'a self, attr: &'a FileAttr) -> OsResult<'a, ()> { + pub fn set_attr<'a>(&'a self, attr: &'a FileAttr) -> OsResult<'a, ()> { unsafe { libc::chmod(self.as_ptr(), (attr.st.st_mode & 0o777).as_()).check_os_err( "chmod", @@ -507,7 +502,7 @@ impl FsPath for FsPathFollow { Ok(()) } - fn get_secontext(&self, con: &mut dyn Utf8CStrBuf) -> OsResult<()> { + pub fn get_secontext(&self, con: &mut dyn Utf8CStrBuf) -> OsResult<()> { unsafe { let sz = libc::getxattr( self.as_ptr(), @@ -527,7 +522,7 @@ impl FsPath for FsPathFollow { Ok(()) } - fn set_secontext<'a>(&'a self, con: &'a Utf8CStr) -> OsResult<'a, ()> { + pub fn set_secontext<'a>(&'a self, con: &'a Utf8CStr) -> OsResult<'a, ()> { unsafe { libc::setxattr( self.as_ptr(), diff --git a/native/src/base/lib.rs b/native/src/base/lib.rs index 13eeb814d..33f237ac6 100644 --- a/native/src/base/lib.rs +++ b/native/src/base/lib.rs @@ -15,7 +15,6 @@ pub use ffi::fork_dont_care; pub use files::*; pub use logging::*; pub use misc::*; -pub use mount::*; pub use result::*; pub mod cstr; diff --git a/native/src/base/mount.rs b/native/src/base/mount.rs index e7ec789c0..2a158dd0c 100644 --- a/native/src/base/mount.rs +++ b/native/src/base/mount.rs @@ -1,10 +1,9 @@ use crate::{LibcReturn, OsResult, Utf8CStr}; use libc::c_ulong; -use std::ops::Deref; use std::ptr; -pub trait FsPathMnt: Deref { - fn bind_mount_to<'a>(&'a self, path: &'a Utf8CStr) -> OsResult<'a, ()> { +impl Utf8CStr { + pub fn bind_mount_to<'a>(&'a self, path: &'a Utf8CStr) -> OsResult<'a, ()> { unsafe { libc::mount( self.as_ptr(), @@ -17,7 +16,7 @@ pub trait FsPathMnt: Deref { } } - fn remount_with_flags(&self, flags: c_ulong) -> OsResult<()> { + pub fn remount_with_flags(&self, flags: c_ulong) -> OsResult<()> { unsafe { libc::mount( ptr::null(), @@ -30,7 +29,7 @@ pub trait FsPathMnt: Deref { } } - fn remount_with_data(&self, data: &Utf8CStr) -> OsResult<()> { + pub fn remount_with_data(&self, data: &Utf8CStr) -> OsResult<()> { unsafe { libc::mount( ptr::null(), @@ -43,7 +42,7 @@ pub trait FsPathMnt: Deref { } } - fn move_mount_to<'a>(&'a self, path: &'a Utf8CStr) -> OsResult<'a, ()> { + pub fn move_mount_to<'a>(&'a self, path: &'a Utf8CStr) -> OsResult<'a, ()> { unsafe { libc::mount( self.as_ptr(), @@ -56,13 +55,13 @@ pub trait FsPathMnt: Deref { } } - fn unmount(&self) -> OsResult<()> { + pub fn unmount(&self) -> OsResult<()> { unsafe { libc::umount2(self.as_ptr(), libc::MNT_DETACH).check_os_err("unmount", Some(self), None) } } - fn set_mount_private(&self, recursive: bool) -> OsResult<()> { + pub fn set_mount_private(&self, recursive: bool) -> OsResult<()> { let flag = if recursive { libc::MS_REC } else { 0 }; unsafe { libc::mount( diff --git a/native/src/base/xwrap.rs b/native/src/base/xwrap.rs index 8c6553e6e..273fd4ce6 100644 --- a/native/src/base/xwrap.rs +++ b/native/src/base/xwrap.rs @@ -2,8 +2,7 @@ use crate::cxx_extern::readlinkat; use crate::{ - BorrowedDirectory, CxxResultExt, FsPath, LibcReturn, Utf8CStr, cstr, slice_from_ptr, - slice_from_ptr_mut, + BorrowedDirectory, CxxResultExt, LibcReturn, Utf8CStr, cstr, slice_from_ptr, slice_from_ptr_mut, }; use libc::{ c_char, c_uint, c_ulong, c_void, dev_t, mode_t, nfds_t, off_t, pollfd, sockaddr, socklen_t, diff --git a/native/src/boot/cpio.rs b/native/src/boot/cpio.rs index 7f596e415..25c561e89 100644 --- a/native/src/boot/cpio.rs +++ b/native/src/boot/cpio.rs @@ -20,8 +20,8 @@ use base::libc::{ c_char, dev_t, gid_t, major, makedev, minor, mknod, mode_t, uid_t, }; use base::{ - BytesExt, EarlyExitExt, FsPath, LoggedResult, MappedFile, ResultExt, Utf8CStr, Utf8CStrBuf, - WriteExt, cstr, log_err, map_args, + BytesExt, EarlyExitExt, LoggedResult, MappedFile, ResultExt, Utf8CStr, Utf8CStrBuf, WriteExt, + cstr, log_err, map_args, }; use crate::check_env; diff --git a/native/src/core/daemon.rs b/native/src/core/daemon.rs index e1236e644..743c1d216 100644 --- a/native/src/core/daemon.rs +++ b/native/src/core/daemon.rs @@ -10,9 +10,7 @@ use crate::mount::{clean_mounts, setup_mounts}; use crate::package::ManagerInfo; use crate::su::SuInfo; use base::libc::{O_CLOEXEC, O_RDONLY}; -use base::{ - AtomicArc, BufReadExt, FsPath, FsPathBuilder, ResultExt, Utf8CStr, cstr, error, info, libc, -}; +use base::{AtomicArc, BufReadExt, FsPathBuilder, ResultExt, Utf8CStr, cstr, error, info, libc}; use std::io::BufReader; use std::os::unix::net::UnixStream; use std::sync::atomic::{AtomicBool, AtomicU32, Ordering}; diff --git a/native/src/core/mount.rs b/native/src/core/mount.rs index e3245da4c..6338aa858 100644 --- a/native/src/core/mount.rs +++ b/native/src/core/mount.rs @@ -7,8 +7,8 @@ use num_traits::AsPrimitive; use base::libc::{c_uint, dev_t}; use base::{ - FsPath, FsPathBuilder, FsPathMnt, LibcReturn, LoggedResult, MountInfo, ResultExt, Utf8CStr, - Utf8CStrBuf, cstr, debug, info, libc, parse_mount_info, warn, + FsPathBuilder, LibcReturn, LoggedResult, MountInfo, ResultExt, Utf8CStr, Utf8CStrBuf, cstr, + debug, info, libc, parse_mount_info, warn, }; use crate::consts::{MODULEMNT, MODULEROOT, PREINITDEV, PREINITMIRR, WORKERDIR}; diff --git a/native/src/core/package.rs b/native/src/core/package.rs index 545e83150..817c10c60 100644 --- a/native/src/core/package.rs +++ b/native/src/core/package.rs @@ -4,8 +4,8 @@ use crate::ffi::{DbEntryKey, get_magisk_tmp, install_apk, uninstall_pkg}; use base::WalkResult::{Abort, Continue, Skip}; use base::libc::{O_CLOEXEC, O_CREAT, O_RDONLY, O_TRUNC, O_WRONLY}; use base::{ - BufReadExt, Directory, FsPath, FsPathBuilder, LoggedResult, ReadExt, ResultExt, Utf8CStrBuf, - cstr, error, fd_get_attr, warn, + BufReadExt, Directory, FsPathBuilder, LoggedResult, ReadExt, ResultExt, Utf8CStrBuf, cstr, + error, fd_get_attr, warn, }; use bit_set::BitSet; use cxx::CxxString; diff --git a/native/src/core/resetprop/persist.rs b/native/src/core/resetprop/persist.rs index 21be770af..f666071ac 100644 --- a/native/src/core/resetprop/persist.rs +++ b/native/src/core/resetprop/persist.rs @@ -16,8 +16,8 @@ use crate::resetprop::proto::persistent_properties::{ use base::const_format::concatcp; use base::libc::{O_CLOEXEC, O_RDONLY}; use base::{ - Directory, FsPath, FsPathBuilder, LibcReturn, LoggedResult, MappedFile, SilentResultExt, - Utf8CStr, Utf8CStrBuf, WalkResult, clone_attr, cstr, debug, libc::mkstemp, + Directory, FsPathBuilder, LibcReturn, LoggedResult, MappedFile, SilentResultExt, Utf8CStr, + Utf8CStrBuf, WalkResult, clone_attr, cstr, debug, libc::mkstemp, }; const PERSIST_PROP_DIR: &str = "/data/property"; diff --git a/native/src/core/zygisk/daemon.rs b/native/src/core/zygisk/daemon.rs index 330ef6bf7..02d312551 100644 --- a/native/src/core/zygisk/daemon.rs +++ b/native/src/core/zygisk/daemon.rs @@ -6,7 +6,7 @@ use crate::ffi::{ use crate::socket::{IpcRead, UnixSocketExt}; use base::libc::{O_CLOEXEC, O_CREAT, O_RDONLY, STDOUT_FILENO}; use base::{ - Directory, FsPath, FsPathBuilder, LoggedError, LoggedResult, ResultExt, WriteExt, cstr, error, + Directory, FsPathBuilder, LoggedError, LoggedResult, ResultExt, WriteExt, cstr, error, fork_dont_care, libc, raw_cstr, warn, }; use std::fmt::Write; diff --git a/native/src/init/getinfo.rs b/native/src/init/getinfo.rs index 6c114c6b3..d26d99db4 100644 --- a/native/src/init/getinfo.rs +++ b/native/src/init/getinfo.rs @@ -1,5 +1,5 @@ use crate::ffi::{BootConfig, MagiskInit, backup_init}; -use base::{BytesExt, FsPath, MappedFile, cstr}; +use base::{BytesExt, MappedFile, cstr}; impl BootConfig { #[allow(unused_imports, unused_unsafe)] diff --git a/native/src/init/init.rs b/native/src/init/init.rs index 02033f4fc..08df1169e 100644 --- a/native/src/init/init.rs +++ b/native/src/init/init.rs @@ -6,7 +6,7 @@ use crate::{ logging::setup_klog, }; use base::{ - FsPath, FsPathMnt, LibcReturn, LoggedResult, ResultExt, cstr, info, + LibcReturn, LoggedResult, ResultExt, cstr, info, libc::{basename, getpid, mount, umask}, raw_cstr, }; diff --git a/native/src/init/logging.rs b/native/src/init/logging.rs index a681604c3..997651aef 100644 --- a/native/src/init/logging.rs +++ b/native/src/init/logging.rs @@ -1,5 +1,5 @@ use base::{ - FsPath, LOGGER, LogLevel, Logger, SilentResultExt, Utf8CStr, cstr, + LOGGER, LogLevel, Logger, SilentResultExt, Utf8CStr, cstr, libc::{ O_CLOEXEC, O_RDWR, O_WRONLY, S_IFCHR, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, SYS_dup3, makedev, mknod, syscall, diff --git a/native/src/init/mount.rs b/native/src/init/mount.rs index 8526d51e6..f26224d71 100644 --- a/native/src/init/mount.rs +++ b/native/src/init/mount.rs @@ -1,8 +1,7 @@ use crate::ffi::MagiskInit; use base::libc::{TMPFS_MAGIC, statfs}; use base::{ - Directory, FsPath, FsPathBuilder, FsPathMnt, LibcReturn, LoggedResult, ResultExt, Utf8CStr, - cstr, debug, libc, + Directory, FsPathBuilder, LibcReturn, LoggedResult, ResultExt, Utf8CStr, cstr, debug, libc, libc::{chdir, chroot, execve, exit, mount}, parse_mount_info, raw_cstr, }; diff --git a/native/src/init/rootdir.rs b/native/src/init/rootdir.rs index e1abe6fb9..b2d9e30c4 100644 --- a/native/src/init/rootdir.rs +++ b/native/src/init/rootdir.rs @@ -2,8 +2,8 @@ use crate::consts::{ROOTMNT, ROOTOVL}; use crate::ffi::MagiskInit; use base::libc::{O_CREAT, O_RDONLY, O_WRONLY}; use base::{ - BufReadExt, Directory, FsPath, FsPathBuilder, FsPathMnt, LoggedResult, ResultExt, Utf8CStr, - Utf8CString, clone_attr, cstr, debug, + BufReadExt, Directory, FsPathBuilder, LoggedResult, ResultExt, Utf8CStr, Utf8CString, + clone_attr, cstr, debug, }; use std::io::BufReader; use std::{ diff --git a/native/src/init/selinux.rs b/native/src/init/selinux.rs index c1957950f..d516c54c1 100644 --- a/native/src/init/selinux.rs +++ b/native/src/init/selinux.rs @@ -2,8 +2,8 @@ use crate::consts::{PREINITMIRR, SELINUXMOCK}; use crate::ffi::{MagiskInit, preload_ack, preload_lib, preload_policy, split_plat_cil}; use base::const_format::concatcp; use base::{ - BytesExt, FsPath, FsPathMnt, LibcReturn, LoggedResult, MappedFile, ResultExt, Utf8CStr, cstr, - debug, error, info, libc, raw_cstr, + BytesExt, LibcReturn, LoggedResult, MappedFile, ResultExt, Utf8CStr, cstr, debug, error, info, + libc, raw_cstr, }; use magiskpolicy::ffi::SePolicy; use std::io::{Read, Write}; diff --git a/native/src/init/twostage.rs b/native/src/init/twostage.rs index d9f66c1b2..d132392e3 100644 --- a/native/src/init/twostage.rs +++ b/native/src/init/twostage.rs @@ -1,6 +1,6 @@ use crate::ffi::MagiskInit; use base::{ - FsPath, FsPathMnt, LoggedResult, MappedFile, MutBytesExt, ResultExt, cstr, debug, error, + LoggedResult, MappedFile, MutBytesExt, ResultExt, cstr, debug, error, libc::{O_CLOEXEC, O_CREAT, O_RDONLY, O_WRONLY}, }; use std::io::Write; diff --git a/native/src/sepolicy/statement.rs b/native/src/sepolicy/statement.rs index 5a1158346..9da73c5c5 100644 --- a/native/src/sepolicy/statement.rs +++ b/native/src/sepolicy/statement.rs @@ -5,7 +5,7 @@ use std::{iter::Peekable, vec::IntoIter}; use crate::SePolicy; use crate::ffi::Xperm; use base::libc::{O_CLOEXEC, O_RDONLY}; -use base::{BufReadExt, FsPath, LoggedResult, Utf8CStr, error, warn}; +use base::{BufReadExt, LoggedResult, Utf8CStr, error, warn}; pub enum Token<'a> { AL,