]> git.pld-linux.org Git - packages/dhcp.git/blob - dhcp-errwarn-message.patch
- updated to 4.4.3-P1
[packages/dhcp.git] / dhcp-errwarn-message.patch
1 diff -up dhcp-4.3.5/omapip/errwarn.c.errwarn dhcp-4.3.5/omapip/errwarn.c
2 --- dhcp-4.3.5/omapip/errwarn.c.errwarn 2016-09-27 21:16:50.000000000 +0200
3 +++ dhcp-4.3.5/omapip/errwarn.c 2016-11-29 19:44:03.515031147 +0100
4 @@ -49,6 +49,41 @@ void (*log_cleanup) (void);
5  static char mbuf [CVT_BUF_MAX + 1];
6  static char fbuf [CVT_BUF_MAX + 1];
7  
8 +// get BUG_REPORT_URL from /etc/os-release
9 +char * bug_report_url(void) {
10 +    FILE * file = fopen("/etc/os-release", "r");
11 +    size_t len;
12 +    char * line = NULL;
13 +    char * url = NULL;
14 +    size_t url_len = 256;
15 +
16 +    url = (char *) malloc(url_len * sizeof(char));
17 +    strcpy(url, "https://bugzilla.redhat.com/");
18 +
19 +    if (!file)
20 +        return url;
21 +
22 +    while ((getline(&line, &len, file)) != -1) {
23 +        if (strstr(line, "BUG_REPORT_URL") != NULL) {
24 +            char * start = strchr(line, '=');
25 +            char * rquotes = strrchr(line, '"');
26 +
27 +            if (rquotes != NULL) {
28 +                *rquotes = '\0';
29 +                strncpy(url, start+2, url_len);
30 +            } else {
31 +                strncpy(url, start+1, url_len);
32 +            }
33 +            url[url_len-1] = '\0';
34 +            fclose(file);
35 +            return url;
36 +        }
37 +    }
38 +    fclose(file);
39 +    return url;
40 +}
41 +
42 +
43  /* Log an error message, then exit... */
44  
45  void log_fatal (const char * fmt, ... )
46 @@ -75,11 +110,13 @@ void log_fatal (const char * fmt, ... )
47    }
48  
49    log_error ("%s", "");
50 -  log_error ("If you think you have received this message due to a bug rather");
51 -  log_error ("than a configuration issue please read the section on submitting");
52 -  log_error ("bugs on either our web page at www.isc.org or in the README file");
53 -  log_error ("before submitting a bug.  These pages explain the proper");
54 -  log_error ("process and the information we find helpful for debugging..");
55 +  log_error ("This version of ISC DHCP is based on the release available");
56 +  log_error ("on ftp.isc.org. Features have been added and other changes");
57 +  log_error ("have been made to the base software release in order to make");
58 +  log_error ("it work better with this distribution.");
59 +  log_error ("%s", "");
60 +  log_error ("Please report issues with this software via: ");
61 +  log_error ("%s", bug_report_url());
62    log_error ("%s", "");
63    log_error ("exiting.");
64  
This page took 0.078338 seconds and 3 git commands to generate.