From ed42cf42d27bc0f84c8deb332063fd21e67056f4 Mon Sep 17 00:00:00 2001 From: tiann Date: Fri, 3 Feb 2023 10:00:52 +0800 Subject: [PATCH] ksud: restore syscon before module install script; this revert 2a4675e25b30a6679ed859177b1fcf38877c840c --- userspace/ksud/src/module.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/userspace/ksud/src/module.rs b/userspace/ksud/src/module.rs index 45365ef0..04a61049 100644 --- a/userspace/ksud/src/module.rs +++ b/userspace/ksud/src/module.rs @@ -455,17 +455,16 @@ fn _install_module(zip: &str) -> Result<()> { let mut archive = zip::ZipArchive::new(file)?; archive.extract(&module_dir)?; - exec_install_script(zip)?; - // set permission and selinux context for $MOD/system let module_system_dir = PathBuf::from(module_dir).join("system"); if module_system_dir.exists() { - let path = module_system_dir.to_str().unwrap(); #[cfg(unix)] set_permissions(&module_system_dir, Permissions::from_mode(0o755))?; - restore_syscon(path)?; + restore_syscon(&module_system_dir)?; } + exec_install_script(zip)?; + info!("rename {tmp_module_img} to {}", defs::MODULE_UPDATE_IMG); // all done, rename the tmp image to modules_update.img if std::fs::rename(tmp_module_img, defs::MODULE_UPDATE_IMG).is_err() {