summaryrefslogtreecommitdiff
path: root/init/src/mounts/rescue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'init/src/mounts/rescue.rs')
-rw-r--r--init/src/mounts/rescue.rs22
1 files changed, 12 insertions, 10 deletions
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());