Browse code

Old-style db.XY.clamav.net and db.XY.ipv6.clamav.net entries now redirect to https://database.clamav.net.

Micah Snyder authored on 2019/06/07 05:37:05
Showing 3 changed files
... ...
@@ -67,6 +67,8 @@ Example
67 67
 # Now that CloudFlare is being used as our Content Delivery Network (CDN),
68 68
 # this one domain name works world-wide to direct freshclam to the closest
69 69
 # geographic endpoint.
70
+# If the old db.XY.clamav.net domains are set, freshclam will automatically
71
+# use database.clamav.net instead.
70 72
 DatabaseMirror database.clamav.net
71 73
 
72 74
 # How many attempts to make before giving up.
... ...
@@ -410,7 +410,14 @@ static fc_error_t get_server_node(
410 410
     /*
411 411
      * Ensure that URL contains protocol.
412 412
      */
413
-    if (!strstr(server, "://")) {
413
+    if (!strncmp(server, "db.", 3) && strstr(server, ".clamav.net")) {
414
+        url = cli_strdup("https://database.clamav.net");
415
+        if (NULL == url) {
416
+            logg("!get_server_node: Failed to duplicate string for database.clamav.net url.\n");
417
+            status = FC_EMEM;
418
+            goto done;
419
+        }
420
+    } else if (!strstr(server, "://")) {
414 421
         urlLen = strlen(defaultProtocol) + strlen("://") + strlen(server);
415 422
         url    = malloc(urlLen + 1);
416 423
         if (NULL == url) {
... ...
@@ -67,6 +67,8 @@ Example
67 67
 # Now that CloudFlare is being used as our Content Delivery Network (CDN),
68 68
 # this one domain name works world-wide to direct freshclam to the closest
69 69
 # geographic endpoint.
70
+# If the old db.XY.clamav.net domains are set, freshclam will automatically
71
+# use database.clamav.net instead.
70 72
 DatabaseMirror database.clamav.net
71 73
 
72 74
 # How many attempts to make before giving up.