Repository navigation
Keep an Other-account Command log under its accepted log directory - #1685
Merged
Merged
Conversation
When logs opens that Command log, read it only when its canonical path stays under the directory discovery accepted for the account.
An Other-account Activity line can name a Command log whose canonical path leaves the accepted directory. Skip that read so logs still shows the account's other Commands.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
thirdshift logs <command>reads an Other-account Command's Command log only when its canonical path stays under that account's accepted log directory. Activity-log recovery, whichlogsruns first, uses the same rule. A symlink whose canonical path stays inside the accepted directory is still read. The serving account has no accepted directory, so its Command logs are read as before.Seam:
thirdshift logs <command>for an Other-account Command, including Activity-log recovery thatlogsloads before it streams the Command log.Evidence
logs widgets#7streamedCANARY-ESCAPED-COMMAND-LOGfrom a Command log symlinked outside the accepted directory. After that stream check,cargo test --test console logs_does_not_read_an_activity_named_command_log_outside_the_accepted_directoryfailed withno Command matches widgets#7: Activity recovery followed a directory symlink, and readable mode dropped the account.After:
other_account_command_logs_stay_under_their_accepted_log_directoryandlogs_does_not_read_an_activity_named_command_log_outside_the_accepted_directorypass.scripts/affected-tests mainran the full Rust suite: 3631 passed, 75 skipped (PASS cargo nextest run, 2236.20s).Merge Danger
Door: two-way
Revert the two commits. Nothing on disk is rewritten.
Blast Radius: Other-account Command logs
A missing Other-account Command log fails
stays_underbefore open, and the stream reportsoutside accepted log directory. Activity recovery still treats a missing log as empty text. The serving account is unchanged.Unaddressed findings
Standards
command_log_text(src/logs/reading/history.rs, lines 291–299). Declined.stays_under(src/logs/reading/inventory.rs, lines 69–72) is false both whencanonicalizefails and when the canonical path leaves the accepted directory. Activity recovery still has to callcache::text(src/logs/reading/cache.rs, lines 133–149) when the path does not resolve:NotFoundstays an empty read, and any other error still fails the capture. Treating everystays_underfailure as escaped would skip that read for a missing Command log. The review recorded this as a judgement call and did not claim the behaviour is wrong.Spec
None. The Activity-log finding was fixed, and its test is kept.
Security
None.
Security review outcome
No unaddressed introduced findings.
Review coverage
The review left no changed file unread.
Closes #1684
Built with grok grok 1.0.70 (f50904eaee6c) [stable] · default model · default effort