Skip to content

Remove readme.txt, repair.zip and ref/ on --clean - #2098

Open
xroche wants to merge 3 commits into
masterfrom
fz/D10
Open

xroche wants to merge 3 commits into
masterfrom
fz/D10

Conversation

@xroche

@xroche xroche commented Nov 7, 2026

Copy link
Copy Markdown
Owner

--clean now also removes hts-cache/readme.txt, hts-cache/repair.zip and the hts-cache/ref/ directory. Before, readme.txt stayed behind on every mirror, so the final RMDIR of hts-cache always failed. cookies.txt and hts-cache/winprofile.ini are still kept on purpose (user state), so a mirror that has them keeps hts-cache.

New test 766 fails on the master binary (the three names remain) and passes here. A control keeps cookies.txt and winprofile.ini. The full suite passes (0 failures). The --help text and man page are unchanged.

xroche and others added 2 commits November 7, 2026 18:56
--clean left hts-cache/readme.txt behind on every mirror, so the final
rmdir of hts-cache always failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
Share one purge_ref_dir with the end-of-mirror cleanup. It skips a symlinked
ref and unlinks only regular files, so it cannot reach cookies.txt or
winprofile.ini.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche enabled auto-merge (squash) November 7, 2026 19:04
Comment thread src/htscoremain.c Fixed
@xroche
xroche disabled auto-merge November 7, 2026 19:46
unlink() never follows the last path component, so a symlinked entry
only loses the link. The lstat guarded nothing and was the check half of
the CodeQL cpp/toctou-race-condition alert 332.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche enabled auto-merge (squash) November 7, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants