Blame SOURCES/0001-change-bug-url.patch

f9ed25
From 23dfbc560028bf7429196db1a3826f8b80c19d3e Mon Sep 17 00:00:00 2001
f9ed25
From: Pavel Zhukov <pzhukov@redhat.com>
f9ed25
Date: Thu, 21 Feb 2019 10:09:57 +0100
f9ed25
Subject: [PATCH 01/26] change bug url
f9ed25
Cc: pzhukov@redhat.com
f9ed25
f9ed25
---
f9ed25
 omapip/errwarn.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
f9ed25
 1 file changed, 42 insertions(+), 5 deletions(-)
f9ed25
f9ed25
diff --git a/omapip/errwarn.c b/omapip/errwarn.c
f9ed25
index e30f8a0..09a3004 100644
f9ed25
--- a/omapip/errwarn.c
f9ed25
+++ b/omapip/errwarn.c
f9ed25
@@ -48,6 +48,41 @@ void (*log_cleanup) (void);
f9ed25
 static char mbuf [CVT_BUF_MAX + 1];
f9ed25
 static char fbuf [CVT_BUF_MAX + 1];
f9ed25
 
f9ed25
+// get BUG_REPORT_URL from /etc/os-release
f9ed25
+char * bug_report_url(void) {
f9ed25
+    FILE * file = fopen("/etc/os-release", "r");
f9ed25
+    size_t len;
f9ed25
+    char * line = NULL;
f9ed25
+    char * url = NULL;
f9ed25
+    size_t url_len = 256;
f9ed25
+
f9ed25
+    url = (char *) malloc(url_len * sizeof(char));
f9ed25
+    strcpy(url, "https://bugzilla.redhat.com/");
f9ed25
+
f9ed25
+    if (!file)
f9ed25
+        return url;
f9ed25
+
f9ed25
+    while ((getline(&line, &len, file)) != -1) {
f9ed25
+        if (strstr(line, "BUG_REPORT_URL") != NULL) {
f9ed25
+            char * start = strchr(line, '=');
f9ed25
+            char * rquotes = strrchr(line, '"');
f9ed25
+
f9ed25
+            if (rquotes != NULL) {
f9ed25
+                *rquotes = '\0';
f9ed25
+                strncpy(url, start+2, url_len);
f9ed25
+            } else {
f9ed25
+                strncpy(url, start+1, url_len);
f9ed25
+            }
f9ed25
+            url[url_len-1] = '\0';
f9ed25
+            fclose(file);
f9ed25
+            return url;
f9ed25
+        }
f9ed25
+    }
f9ed25
+    fclose(file);
f9ed25
+    return url;
f9ed25
+}
f9ed25
+
f9ed25
+
f9ed25
 /* Log an error message, then exit... */
f9ed25
 
f9ed25
 void log_fatal (const char * fmt, ... )
f9ed25
@@ -74,11 +109,13 @@ void log_fatal (const char * fmt, ... )
f9ed25
   }
f9ed25
 
f9ed25
   log_error ("%s", "");
f9ed25
-  log_error ("If you think you have received this message due to a bug rather");
f9ed25
-  log_error ("than a configuration issue please read the section on submitting");
f9ed25
-  log_error ("bugs on either our web page at www.isc.org or in the README file");
f9ed25
-  log_error ("before submitting a bug.  These pages explain the proper");
f9ed25
-  log_error ("process and the information we find helpful for debugging.");
f9ed25
+  log_error ("This version of ISC DHCP is based on the release available");
f9ed25
+  log_error ("on ftp.isc.org. Features have been added and other changes");
f9ed25
+  log_error ("have been made to the base software release in order to make");
f9ed25
+  log_error ("it work better with this distribution.");
f9ed25
+  log_error ("%s", "");
f9ed25
+  log_error ("Please report issues with this software via: ");
f9ed25
+  log_error ("%s", bug_report_url());
f9ed25
   log_error ("%s", "");
f9ed25
   log_error ("exiting.");
f9ed25
 
f9ed25
-- 
f9ed25
2.14.5
f9ed25