summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-21 15:34:53 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-21 17:36:39 +0200
commit41939c374a3ef421d2d4c6453c327a9cd7af4ce5 (patch)
tree6b7b406aa82fdf8e3e9e691c76adbb709d36ec5c
parentgnu: add convmv. (diff)
downloadguix-41939c374a3ef421d2d4c6453c327a9cd7af4ce5.tar.gz
guix-41939c374a3ef421d2d4c6453c327a9cd7af4ce5.tar.bz2
guix-41939c374a3ef421d2d4c6453c327a9cd7af4ce5.tar.xz
git-authenticate: Ignore authenticated commit cache when it's not #o600.
* guix/git-authenticate.scm (previously-authenticated-commits): Stat PORT; return the empty list if it's no #o600 and change it to #o600.
-rw-r--r--guix/git-authenticate.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/git-authenticate.scm b/guix/git-authenticate.scm
index 228d551..082c44e 100644
--- a/guix/git-authenticate.scm
+++ b/guix/git-authenticate.scm
@@ -306,7 +306,14 @@ IDs (hex strings)."
306 (catch 'system-error 306 (catch 'system-error
307 (lambda () 307 (lambda ()
308 (call-with-input-file (authenticated-commit-cache-file key) 308 (call-with-input-file (authenticated-commit-cache-file key)
309 read)) 309 (lambda (port)
310 ;; If PORT has the wrong permissions, it might have been tampered
311 ;; with by another user so ignore its contents.
312 (if (= #o600 (stat:perms (stat port)))
313 (read port)
314 (begin
315 (chmod port #o600)
316 '())))))
310 (lambda args 317 (lambda args
311 (if (= ENOENT (system-error-errno args)) 318 (if (= ENOENT (system-error-errno args))
312 '() 319 '()