summaryrefslogtreecommitdiff
path: root/init/src/mounts
diff options
context:
space:
mode:
Diffstat (limited to 'init/src/mounts')
-rw-r--r--init/src/mounts/fstab.rs5
-rw-r--r--init/src/mounts/rescue.rs22
2 files changed, 16 insertions, 11 deletions
diff --git a/init/src/mounts/fstab.rs b/init/src/mounts/fstab.rs
index 4d9b474..7d71520 100644
--- a/init/src/mounts/fstab.rs
+++ b/init/src/mounts/fstab.rs
@@ -135,7 +135,10 @@ impl FstabEntry {
pub fn mount(&self) -> Result<(), Box<dyn std::error::Error>> {
if let Err(e) = Self::check_mount_point_permissions(&self.mountpoint) {
- log_warning(&format!("Permission check failed for {}: {}", self.mountpoint, e));
+ log_warning(&format!(
+ "Permission check failed for {}: {}",
+ self.mountpoint, e
+ ));
}
log_success(&format!(
diff --git a/init/src/mounts/rescue.rs b/init/src/mounts/rescue.rs
index 2238297..385f851 100644
--- a/init/src/mounts/rescue.rs
+++ b/init/src/mounts/rescue.rs
@@ -13,10 +13,10 @@ fn check_mount_point_permissions(path: &str) -> Result<(), Box<dyn std::error::E
if !meta.is_dir() {
return Err(format!("Mount point {} is not a directory", path).into());
}
-
+
// TODO
// let mode = meta.mode();
-
+
let uid = meta.uid();
if uid != 0 {
log_warning(&format!("Warning: Mount point {} not owned by root", path));
@@ -45,15 +45,17 @@ pub fn mount_system() -> Result<(), Box<dyn std::error::Error>> {
// let source_c = source.map(|s| CString::new(s).map_err(|e| ));
let source_c = match source {
Some(s) => match CString::new(s) {
- Ok(c_string) => Some(c_string),
+ Ok(c_string) => Some(c_string),
Err(null_err) => {
- log_warning(&format!("Source string contains NULL bytes (\\0), skipping: {}", null_err));
- continue;
- }
- },
- None => None
- };
-
+ log_warning(&format!(
+ "Source string contains NULL bytes (\\0), skipping: {}",
+ null_err
+ ));
+ continue;
+ }
+ },
+ None => None,
+ };
let source_ptr = source_c.as_ref().map_or(std::ptr::null(), |s| s.as_ptr());