[FEATURE] Run the SHA-2 command with explicit native file and stream authority #4
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/sha2-tool#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and motivation
The shared SHA-2 command already parses before I/O and hashes incrementally, but its executable currently runs only on Linux. EriX needs the same command to hash explicitly selected files and inherited standard input during native builds.
Proposed behavior and scope
Add an EriX entry and backend for both
sha256andsha512, preserving the current grammar, records and exit statuses. Stream input in reusable chunks; file size must not determine temporary memory use. Prepare the complete invocation before binding selected input and output owners.Reuse LibStdio's checked stream cursors and move common stream framing there. Put the shared, opt-in native command broker/file client in LibCli and migrate Coreutils to it, so these tools use one checked implementation. Use existing launch startup and capability-inventory contracts. The prepared command's allocations use an explicitly sized process-owned workspace; no allocator, filesystem or service lookup fallback is permitted. Linux behavior remains unchanged.
Authority, security and reliability
A file operand may request only an exact invocation-lifetime READ lease through the inherited, manifest-bounded job broker. Argument bytes select an operand, never a service or capability. Standard input is consumed at most once, and output uses only selected inherited descriptors. No write-file, publication, clock, network or launch route is needed.
Validate original correlations, reply framing and installed rights. Finalize a digest only after confirmed EOF and exact input retirement. Preserve the first failure, do not replay uncertain calls, and retain unresolved custody through final cleanup; ordinary command status alone cannot authorize process exit.
Acceptance criteria
Alternatives and tradeoffs
A second private transport would duplicate security-sensitive framing and retirement logic. A POSIX adapter would add an unnecessary authority boundary. Shared native clients keep those checks in one place; the explicit workspace still has an ordinary deployment resource limit, which must be reported rather than hidden as a command limit.
Tracking and rollout
Part of erix/integration#8. Continues #1 and #2. Land shared clients and their Coreutils migration with the native backend, then adopt the coherent supplier graph and guest fixtures in Integration.
Published the native backend at
140f0ef8, with shared clients in LibStdio521f200d and LibClia2a8001b. Coreutils988aba63 uses those same clients. File hashes require confirmed EOF and lease retirement; inherited stream aliases share their original cursors and cleanup state. Integration packaging and the guest file/stdin/redirection cases are next.40087040replaces the private heap with LibOwnedRegion’s allocator over the original packaged workspace. No new backing route is acquired. The native feature is gated consistently, and the manual inventory binds all 16 implemented source inputs.