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