aboutsummaryrefslogtreecommitdiff
path: root/tests/test-gptel-tools-git-diff.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-23 19:14:29 -0500
committerCraig Jennings <c@cjennings.net>2026-05-23 19:14:29 -0500
commit321ac3d6e9f7fcbddb8793de23c06591b35c80fb (patch)
treeec2d6f25a68cc139467fb26f2b9e1ca9ff741938 /tests/test-gptel-tools-git-diff.el
parent3b8fbdf25b6cf2f20e3c575c44daa8062f91251c (diff)
downloaddotemacs-321ac3d6e9f7fcbddb8793de23c06591b35c80fb.tar.gz
dotemacs-321ac3d6e9f7fcbddb8793de23c06591b35c80fb.zip
fix(dwim-shell): delete password temp file after the process exits
The four password commands (PDF protect/unprotect, remove-zip-encryption, create-encrypted-zip) wrote the password to a temp file, launched an async dwim-shell command, then deleted the file in unwind-protect. Since the command is async, that delete ran the instant it launched, so qpdf or 7z could start after the password file was already gone. I extracted cj/dwim-shell--run-with-password-file and cj/dwim-shell--password-cleanup-callback. The temp file (mode 600) is now deleted from an :on-completion callback that fires after the process exits, on both success and failure, and the synchronous unwind-protect stays only as a backstop for a throw before the async launch. All four commands now go through the one helper. qpdf already reads the password via --password-file, so it stays out of the argv. 7z still takes it as -p"$(cat ...)", which lands on its command line. That's tracked as a separate follow-up.
Diffstat (limited to 'tests/test-gptel-tools-git-diff.el')
0 files changed, 0 insertions, 0 deletions