mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-07 10:36:05 -10:00
fix(plugins): validate stages appearing during registry load [skip ci]
Route an initially unstaged plugin whose destination appears concurrently through the existing restage writer lock, current receipt and policy checks. Retain refusal and the existing failure cache for invalid bytes. No new authority or recovery mechanism. Verified: exact one-file diff, git diff --check, Rust syntax parsing and independent review. Fresh compile and runtime qualification pending; held locally for a stamped qualification build, not pushed.
This commit is contained in:
1 parent
147bd65c4c
commit
91fd65705a
1 file changed
+6
-3
@@ -687,10 +687,13 @@ impl PluginRegistry {
|
||||
return None;
|
||||
}
|
||||
let destination = runtime_stage_path(&state_path, &plugin.id, &plugin.content_hash);
|
||||
if !matches!(fs::symlink_metadata(&destination), Err(error) if error.kind() == std::io::ErrorKind::NotFound) {
|
||||
return None;
|
||||
match fs::symlink_metadata(&destination) {
|
||||
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
|
||||
Some(plugin.id.as_str().to_string())
|
||||
}
|
||||
Ok(_) if plugin.staged_root.is_none() => Some(plugin.id.as_str().to_string()),
|
||||
_ => None,
|
||||
}
|
||||
Some(plugin.id.as_str().to_string())
|
||||
}).collect::<Vec<_>>();
|
||||
for selector in candidates {
|
||||
if let Err(error) = self.restage_inner(&selector, true) {
|
||||
|
||||
Reference in new issue
Block a user