Skip to content

Make doit.log, the crawl logs and the progress lock owner-only - #2001

Merged
xroche merged 3 commits into
masterfrom
doitlog-perms
Oct 21, 2026
Merged

xroche merged 3 commits into
masterfrom
doitlog-perms

Conversation

@xroche

@xroche xroche commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

On POSIX, doit.log, hts-log.txt, hts-err.txt, hts-ioinfo.txt, the progress lock, the cache's new.txt and new.zip, and WebHTTrack's winprofile.ini are now owner-only, because each can hold passwords. They use the cookie jar's open helper, now hts_fopen_private(), which also tightens an old doit.log that an earlier run left at 0644.

doit.log, hts-log.txt, hts-err.txt and hts-in_progress.lock echo the
command line, which can hold a password from a URL, a -%X header or a
proxy option. Under umask 022 all of them came out 0644.

They now open through hts_fopen_private(), the cookie jar's open moved
to htslib.c. It creates the file 0600 and fchmods an existing one before
the first write. Windows keeps the folder's ACL.

Test 658 checks the modes after a crawl, after an --update over 0644
files, and for the lock while a crawl runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
Comment thread src/htslib.c Fixed
Review round 1 of #2001. hts-ioinfo.txt, hts-cache/new.txt, new.zip
and WebHTTrack's winprofile.ini also hold passwords, so they now open
through hts_fopen_private(). It moves to htslines.c, which htsserver
also compiles, and it refuses any mode but "w" and "wb".

Test 658 now runs a self-test that reads the mode before the first
write. It checks hts-err.txt and the files above, and it holds a crawl
on a trickling page so the lock is always there to read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche xroche changed the title Keep doit.log and the crawl log readable by their owner only Make doit.log, the crawl logs and the progress lock owner-only Oct 21, 2026
Comment thread src/htslines.c Dismissed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche enabled auto-merge (squash) October 21, 2026 13:09
@xroche
xroche merged commit 0885bc7 into master Oct 21, 2026
37 of 38 checks passed
@xroche
xroche deleted the doitlog-perms branch October 21, 2026 14:08
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