summaryrefslogtreecommitdiff
path: root/guix/git-authenticate.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/git-authenticate.scm')
-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 228d551d11..082c44ee06 100644
--- a/guix/git-authenticate.scm
+++ b/guix/git-authenticate.scm
@@ -306,7 +306,14 @@ IDs (hex strings)."
(catch 'system-error
(lambda ()
(call-with-input-file (authenticated-commit-cache-file key)
- read))
+ (lambda (port)
+ ;; If PORT has the wrong permissions, it might have been tampered
+ ;; with by another user so ignore its contents.
+ (if (= #o600 (stat:perms (stat port)))
+ (read port)
+ (begin
+ (chmod port #o600)
+ '())))))
(lambda args
(if (= ENOENT (system-error-errno args))
'()