1 From 5e9162c5ad7aa98f7f673ac7a7f46905ba2deea4 Mon Sep 17 00:00:00 2001
2 From: Pavel Zhukov <pzhukov@redhat.com>
3 Date: Thu, 21 Feb 2019 10:09:57 +0100
4 Subject: [PATCH 01/28] change bug url
7 omapip/errwarn.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
8 1 file changed, 42 insertions(+), 5 deletions(-)
10 diff --git a/omapip/errwarn.c b/omapip/errwarn.c
11 index 38dd9c5..d88e392 100644
12 --- a/omapip/errwarn.c
13 +++ b/omapip/errwarn.c
14 @@ -48,6 +48,41 @@ void (*log_cleanup) (void);
15 static char mbuf [CVT_BUF_MAX + 1];
16 static char fbuf [CVT_BUF_MAX + 1];
18 +// get BUG_REPORT_URL from /etc/os-release
19 +char * bug_report_url(void) {
20 + FILE * file = fopen("/etc/os-release", "r");
24 + size_t url_len = 256;
26 + url = (char *) malloc(url_len * sizeof(char));
27 + strcpy(url, "https://bugzilla.redhat.com/");
32 + while ((getline(&line, &len, file)) != -1) {
33 + if (strstr(line, "BUG_REPORT_URL") != NULL) {
34 + char * start = strchr(line, '=');
35 + char * rquotes = strrchr(line, '"');
37 + if (rquotes != NULL) {
39 + strncpy(url, start+2, url_len);
41 + strncpy(url, start+1, url_len);
43 + url[url_len-1] = '\0';
53 /* Log an error message, then exit... */
55 void log_fatal (const char * fmt, ... )
56 @@ -74,11 +109,13 @@ void log_fatal (const char * fmt, ... )
60 - log_error ("If you think you have received this message due to a bug rather");
61 - log_error ("than a configuration issue please read the section on submitting");
62 - log_error ("bugs on either our web page at www.isc.org or in the README file");
63 - log_error ("before submitting a bug. These pages explain the proper");
64 - log_error ("process and the information we find helpful for debugging.");
65 + log_error ("This version of ISC DHCP is based on the release available");
66 + log_error ("on ftp.isc.org. Features have been added and other changes");
67 + log_error ("have been made to the base software release in order to make");
68 + log_error ("it work better with this distribution.");
69 + log_error ("%s", "");
70 + log_error ("Please report issues with this software via: ");
71 + log_error ("%s", bug_report_url());
73 log_error ("exiting.");