Blame SOURCES/dhcp-errwarn-message.patch

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