guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/04: lint: cve: Catch host name lookup errors.


From: Ludovic Courtès
Subject: 04/04: lint: cve: Catch host name lookup errors.
Date: Wed, 06 Jan 2016 15:49:50 +0000

civodul pushed a commit to branch master
in repository guix.

commit f888c0b1207a92b0d7af4dcf7fb73cecd1f0b34f
Author: Ludovic Courtès <address@hidden>
Date:   Wed Jan 6 15:53:20 2016 +0100

    lint: cve: Catch host name lookup errors.
    
    * guix/scripts/lint.scm (package-vulnerabilities): Catch
    'getaddrinfo-error'.
---
 guix/scripts/lint.scm |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index f296f8a..e2cc965 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 Cyril Roelandt <address@hidden>
 ;;; Copyright © 2014, 2015 Eric Bavier <address@hidden>
-;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2015 Mathieu Lirzin <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -593,7 +593,16 @@ Common Platform Enumeration (CPE) name."
 
 (define package-vulnerabilities
   (let ((lookup (delay (vulnerabilities->lookup-proc
-                        (current-vulnerabilities)))))
+                        ;; Catch networking errors to allow network-less
+                        ;; operation.
+                        (catch 'getaddrinfo-error
+                          (lambda ()
+                            (current-vulnerabilities))
+                          (lambda (key errcode)
+                            (warn (_ "failed to lookup NIST host: ~a~%")
+                                  (gai-strerror errcode))
+                            (warn (_ "assuming no CVE vulnerabilities~%"))
+                            '()))))))
     (lambda (package)
       "Return a list of vulnerabilities affecting PACKAGE."
       ((force lookup)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]