Skip to contentSkip to conversation

Revert "cve-update-db-native: show IP on failure"

PATCH In review Ross Burton 2 participants 3 messages Jan 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "cve-update-db-native: show IP on failure"

The bug this was intended to find has been resolved, so we don't need this extra noise in the logs.

This reverts commit bd1edfa3d5b1c24cd1192620f7085ee1df03e1af.

---
 meta/recipes-core/meta/cve-update-db-native.bb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
meta/recipes-core/meta/cve-update-db-native.bb +1 -4
index e042e67b09a..079f062f79b 100644
@@ -130,10 +130,7 @@ def update_db_file(db_tmp_file, d):
                 response = urllib.request.urlopen(meta_url, timeout=cve_socket_timeout)
             except urllib.error.URLError as e:
                 cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n')
-                bb.warn("Failed to fetch CVE data (%s)" % e)
-                import socket
-                result = socket.getaddrinfo("nvd.nist.gov", 443, proto=socket.IPPROTO_TCP)
-                bb.warn("Host IPs are %s" % (", ".join(t[4][0] for t in result)))
+                bb.warn("Failed to fetch CVE data (%s)" % e.reason)
                 return False
 
             if response:
Signature · 1 line
2.34.1
#1 lore raw
Quoted 16 lines · Ross Burton

The bug this was intended to find has been resolved, so we don't need this extra noise in the logs.

This reverts commit bd1edfa3d5b1c24cd1192620f7085ee1df03e1af.

---
 meta/recipes-core/meta/cve-update-db-native.bb | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
meta/recipes-core/meta/cve-update-db-native.bb +0 -0
index e042e67b09a..079f062f79b 100644
@@ -130,10 +130,7 @@ def update_db_file(db_tmp_file, d):
                 response = urllib.request.urlopen(meta_url, timeout=cve_socket_timeout)

meta/recipes-core/meta/cve-update-db-native.bb def update_db_file(db_tmp_file, d): · line 136

Quoted 10 lines
meta/recipes-core/meta/cve-update-db-native.bb +1 -4
             except urllib.error.URLError as e:
                 cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n')
-                bb.warn("Failed to fetch CVE data (%s)" % e)
-                import socket
-                result = socket.getaddrinfo("nvd.nist.gov", 443, proto=socket.IPPROTO_TCP)
-                bb.warn("Host IPs are %s" % (", ".join(t[4][0] for t in result)))
+                bb.warn("Failed to fetch CVE data (%s)" % e.reason)
                 return False
 
             if response:

Since the error is only shown on failure cases, isn't this better left?

Cheers,

Richard

#2 lore raw
Quoted 27 lines · Richard Purdie
Quoted 25 lines · Ross Burton

The bug this was intended to find has been resolved, so we don't need this extra noise in the logs.

This reverts commit bd1edfa3d5b1c24cd1192620f7085ee1df03e1af.

---
meta/recipes-core/meta/cve-update-db-native.bb | 5 +----

1 file changed, 1 insertion(+), 4 deletions(-)
meta/recipes-core/meta/cve-update-db-native.bb +1 -4
index e042e67b09a..079f062f79b 100644
@@ -130,10 +130,7 @@ def update_db_file(db_tmp_file, d):
                response = urllib.request.urlopen(meta_url, timeout=cve_socket_timeout)
            except urllib.error.URLError as e:
                cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n')
-                bb.warn("Failed to fetch CVE data (%s)" % e)
-                import socket
-                result = socket.getaddrinfo("nvd.nist.gov", 443, proto=socket.IPPROTO_TCP)
-                bb.warn("Host IPs are %s" % (", ".join(t[4][0] for t in result)))
+                bb.warn("Failed to fetch CVE data (%s)" % e.reason)
                return False
 
Quoted 3 lines

meta/recipes-core/meta/cve-update-db-native.bb def update_db_file(db_tmp_file, d): · line 136

Quoted 1 line
meta/recipes-core/meta/cve-update-db-native.bb +0 -0
            if response:

Since the error is only shown on failure cases, isn't this better left?

It’s boring noise and doesn’t serve any purpose, now that we understand the reason behind the issue it was added to debug. Keep it if you want, but I don’t see the need.

Ross