Hey Ludo,

> However, there’s already a (file-exists? cached) call a few lines
> above.  So what you need instead is a TOCTTOU-free ‘symlink’, along
> these lines:
>
>   (define (symlink/safe old new)
>     (catch 'system-error
>       (lambda ()
>         (symlink old new))
>       (lambda args
>         (unless (= EEXIST (system-error-errno args))
>           (apply throw args)))))
>
>   ;; …
>
>   (define symlink*
>     (lift2 symlink/safe %store-monad))
>
> WDYT?

Fixed with a831ff6bc3f92ab4ecf6135e4d6386f14189ad06.

Thanks,

Mathieu

Reply via email to