ksud: restore syscon before module install script; this revert 2a4675e25b
This commit is contained in:
@@ -455,17 +455,16 @@ fn _install_module(zip: &str) -> Result<()> {
|
|||||||
let mut archive = zip::ZipArchive::new(file)?;
|
let mut archive = zip::ZipArchive::new(file)?;
|
||||||
archive.extract(&module_dir)?;
|
archive.extract(&module_dir)?;
|
||||||
|
|
||||||
exec_install_script(zip)?;
|
|
||||||
|
|
||||||
// set permission and selinux context for $MOD/system
|
// set permission and selinux context for $MOD/system
|
||||||
let module_system_dir = PathBuf::from(module_dir).join("system");
|
let module_system_dir = PathBuf::from(module_dir).join("system");
|
||||||
if module_system_dir.exists() {
|
if module_system_dir.exists() {
|
||||||
let path = module_system_dir.to_str().unwrap();
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
set_permissions(&module_system_dir, Permissions::from_mode(0o755))?;
|
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);
|
info!("rename {tmp_module_img} to {}", defs::MODULE_UPDATE_IMG);
|
||||||
// all done, rename the tmp image to modules_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() {
|
if std::fs::rename(tmp_module_img, defs::MODULE_UPDATE_IMG).is_err() {
|
||||||
|
|||||||
Reference in New Issue
Block a user