]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp-errwarn-message.patch
- updated to 4.4.3, more patches from Fedora
[packages/dhcp.git] / dhcp-errwarn-message.patch
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
5
6 ---
7  omapip/errwarn.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
8  1 file changed, 42 insertions(+), 5 deletions(-)
9
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];
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, ... )
56 @@ -74,11 +109,13 @@ void log_fatal (const char * fmt, ... )
57    }
58  
59    log_error ("%s", "");
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());
72    log_error ("%s", "");
73    log_error ("exiting.");
74  
75 -- 
76 2.35.1
77
This page took 0.054077 seconds and 3 git commands to generate.