1954e27
diff -up dhcp-4.3.5/omapip/errwarn.c.errwarn dhcp-4.3.5/omapip/errwarn.c
1954e27
--- dhcp-4.3.5/omapip/errwarn.c.errwarn	2016-09-27 21:16:50.000000000 +0200
1954e27
+++ dhcp-4.3.5/omapip/errwarn.c	2016-11-29 19:44:03.515031147 +0100
1954e27
@@ -49,6 +49,41 @@ void (*log_cleanup) (void);
1954e27
 static char mbuf [CVT_BUF_MAX + 1];
1954e27
 static char fbuf [CVT_BUF_MAX + 1];
1954e27
 
1954e27
+// get BUG_REPORT_URL from /etc/os-release
1954e27
+char * bug_report_url(void) {
1954e27
+    FILE * file = fopen("/etc/os-release", "r");
1954e27
+    size_t len;
1954e27
+    char * line = NULL;
1954e27
+    char * url = NULL;
1954e27
+    size_t url_len = 256;
1954e27
+
1954e27
+    url = (char *) malloc(url_len * sizeof(char));
1954e27
+    strcpy(url, "https://bugzilla.redhat.com/");
1954e27
+
1954e27
+    if (!file)
1954e27
+        return url;
1954e27
+
1954e27
+    while ((getline(&line, &len, file)) != -1) {
1954e27
+        if (strstr(line, "BUG_REPORT_URL") != NULL) {
1954e27
+            char * start = strchr(line, '=');
1954e27
+            char * rquotes = strrchr(line, '"');
1954e27
+
1954e27
+            if (rquotes != NULL) {
1954e27
+                *rquotes = '\0';
1954e27
+                strncpy(url, start+2, url_len);
1954e27
+            } else {
1954e27
+                strncpy(url, start+1, url_len);
1954e27
+            }
1954e27
+            url[url_len-1] = '\0';
1954e27
+            fclose(file);
1954e27
+            return url;
1954e27
+        }
1954e27
+    }
1954e27
+    fclose(file);
1954e27
+    return url;
1954e27
+}
1954e27
+
1954e27
+
1954e27
 /* Log an error message, then exit... */
1954e27
 
1954e27
 void log_fatal (const char * fmt, ... )
1954e27
@@ -75,11 +110,13 @@ void log_fatal (const char * fmt, ... )
e7bd38e
   }
db449ef
 
db449ef
   log_error ("%s", "");
e7bd38e
-  log_error ("If you think you have received this message due to a bug rather");
e7bd38e
-  log_error ("than a configuration issue please read the section on submitting");
e7bd38e
-  log_error ("bugs on either our web page at www.isc.org or in the README file");
e7bd38e
-  log_error ("before submitting a bug.  These pages explain the proper");
af708bb
-  log_error ("process and the information we find helpful for debugging.");
db449ef
+  log_error ("This version of ISC DHCP is based on the release available");
1954e27
+  log_error ("on ftp.isc.org. Features have been added and other changes");
db449ef
+  log_error ("have been made to the base software release in order to make");
db449ef
+  log_error ("it work better with this distribution.");
e7bd38e
+  log_error ("%s", "");
1954e27
+  log_error ("Please report issues with this software via: ");
1954e27
+  log_error ("%s", bug_report_url());
db449ef
   log_error ("%s", "");
db449ef
   log_error ("exiting.");
e7bd38e