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