]> git.pld-linux.org Git - packages/dhcp.git/blame - dhcp-errwarn-message.patch
- updated to 4.4.3-P1
[packages/dhcp.git] / dhcp-errwarn-message.patch
CommitLineData
15c1a831
MK
1From 5e9162c5ad7aa98f7f673ac7a7f46905ba2deea4 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/28] change bug url
5
6---
7 omapip/errwarn.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
8 1 file changed, 42 insertions(+), 5 deletions(-)
9
10diff --git a/omapip/errwarn.c b/omapip/errwarn.c
11index 38dd9c5..d88e392 100644
12--- a/omapip/errwarn.c
13+++ b/omapip/errwarn.c
14@@ -48,6 +48,41 @@ void (*log_cleanup) (void);
19507c9d
AM
15 static char mbuf [CVT_BUF_MAX + 1];
16 static char fbuf [CVT_BUF_MAX + 1];
17
18+// get BUG_REPORT_URL from /etc/os-release
19+char * bug_report_url(void) {
20+ FILE * file = fopen("/etc/os-release", "r");
21+ size_t len;
22+ char * line = NULL;
23+ char * url = NULL;
24+ size_t url_len = 256;
25+
26+ url = (char *) malloc(url_len * sizeof(char));
27+ strcpy(url, "https://bugzilla.redhat.com/");
28+
29+ if (!file)
30+ return url;
31+
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, '"');
36+
37+ if (rquotes != NULL) {
38+ *rquotes = '\0';
39+ strncpy(url, start+2, url_len);
40+ } else {
41+ strncpy(url, start+1, url_len);
42+ }
43+ url[url_len-1] = '\0';
44+ fclose(file);
45+ return url;
46+ }
47+ }
48+ fclose(file);
49+ return url;
50+}
51+
52+
53 /* Log an error message, then exit... */
54
55 void log_fatal (const char * fmt, ... )
3ae1beff 56@@ -74,11 +109,13 @@ void log_fatal (const char * fmt, ... )
19507c9d 57 }
8c878a4c 58
8c878a4c 59 log_error ("%s", "");
19507c9d
AM
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");
3ae1beff 64- log_error ("process and the information we find helpful for debugging.");
8c878a4c 65+ log_error ("This version of ISC DHCP is based on the release available");
19507c9d 66+ log_error ("on ftp.isc.org. Features have been added and other changes");
8c878a4c
ER
67+ log_error ("have been made to the base software release in order to make");
68+ log_error ("it work better with this distribution.");
19507c9d
AM
69+ log_error ("%s", "");
70+ log_error ("Please report issues with this software via: ");
71+ log_error ("%s", bug_report_url());
8c878a4c
ER
72 log_error ("%s", "");
73 log_error ("exiting.");
19507c9d 74
15c1a831
MK
75--
762.35.1
77
This page took 0.12971 seconds and 4 git commands to generate.