From 13e7f2f03d36d4e1806d65722f75e630ec6532d9 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 11 Aug 2013 06:55:06 -0500 Subject: [PATCH] try to be more accomodating to low-permission contexts when reading the development links file --- racket/collects/planet/private/planet-shared.rkt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/racket/collects/planet/private/planet-shared.rkt b/racket/collects/planet/private/planet-shared.rkt index 01d044ad7e..4ae982701d 100644 --- a/racket/collects/planet/private/planet-shared.rkt +++ b/racket/collects/planet/private/planet-shared.rkt @@ -254,9 +254,13 @@ Various common pieces of code that both the client and server need to access ;; we can only call with-hard-link-lock when the directory containing ;; (HARD-LINK-FILE) exists (if (with-powerful-security-guard (file-exists? (HARD-LINK-FILE))) - (with-hard-link-lock - (λ () - (get-hard-link-table/internal))) + (with-handlers ((exn:fail? (λ (x) (get-hard-link-table/internal)))) + ;; sometimes the with-hard-link-lock code will fail because + ;; a security guard prevents writing; in that case, just try again + ;; but without locking the file. + (with-hard-link-lock + (λ () + (get-hard-link-table/internal)))) '())) ;; row-for-package? : row string (listof string) num num -> boolean