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

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