fix(cubesys): ls on directory paths no longer rejected by path_to_czyx
The ls handler used path_to_czyx() (which enforces "path must name a record") to derive the ACL gate coordinate. Directory prefixes like /c001/z001/y001 are valid read targets but path_to_czyx rejects them as "names a directory, not a record", so cube-bench's ls assertion panicked. Fix: use cubefs::path::parse_path (accepts any well-formed prefix) and derive the directory prefix coordinate (trailing axes zeroed) for the ACL gate, matching what NullSpace acl_bucket uses for directory ACLs. Also: clippy -D warnings — remove unnecessary `c as u8` cast in hash_backend_keys_sorted_order test. Verification: cube-bench runs to completion (ls section printed OK), clippy clean. Co-Authored-By: Hermes Agent
This commit is contained in:
co-authored by
Hermes Agent
parent
ddca08ea73
commit
6627505e70
@@ -887,7 +887,7 @@ mod tests {
|
||||
fn hash_backend_keys_sorted_order() {
|
||||
let mut b = HashBackend::new();
|
||||
for c in 1u8..=3 {
|
||||
b.put(Czyx::new(50, c, 10, 1), vec![c as u8]);
|
||||
b.put(Czyx::new(50, c, 10, 1), vec![c]);
|
||||
}
|
||||
let keys = b.keys();
|
||||
assert_eq!(keys.len(), 3);
|
||||
|
||||
Reference in New Issue
Block a user