version 1.52, 2007/10/17 20:02:33 |
version 1.53, 2008/01/03 03:19:36 |
|
|
const char *categories = "system user library documentation ports kernel " |
const char *categories = "system user library documentation ports kernel " |
"alpha amd64 arm i386 m68k m88k mips ppc sgi sparc sparc64 vax"; |
"alpha amd64 arm i386 m68k m88k mips ppc sgi sparc sparc64 vax"; |
char *version = "4.2"; |
char *version = "4.2"; |
|
const char *comment[] = { |
|
"<synopsis of the problem (one line)>", |
|
"<[ non-critical | serious | critical ] (one line)>", |
|
"<[ low | medium | high ] (one line)>", |
|
"<PR category (one line)>", |
|
"<[ sw-bug | doc-bug | change-request | support ] (one line)>", |
|
"<release number or tag (one line)>", |
|
"<machine, os, target, libraries (multiple lines)>", |
|
"<precise description of the problem (multiple lines)>", |
|
"<code/input/activities to reproduce the problem (multiple lines)>", |
|
"<how to correct or work around the problem, if known (multiple lines)>" |
|
}; |
|
|
struct passwd *pw; |
struct passwd *pw; |
char os[BUFSIZ], rel[BUFSIZ], mach[BUFSIZ], details[BUFSIZ]; |
char os[BUFSIZ], rel[BUFSIZ], mach[BUFSIZ], details[BUFSIZ]; |
|
|
} |
} |
|
|
fputs("\n" |
fputs("\n" |
"<dmesg is attached.>\n" |
"SENDBUG: dmesg is attached.\n" |
"<Feel free to delete or use the -D flag if it contains " |
"SENDBUG: Feel free to delete or use the -D flag if it contains " |
"sensitive information.>\n", fp); |
"sensitive information.\n", fp); |
/* Find last dmesg. */ |
/* Find last dmesg. */ |
for (;;) { |
for (;;) { |
off_t o; |
off_t o; |
|
|
matchline(const char *s, const char *line, size_t linelen) |
matchline(const char *s, const char *line, size_t linelen) |
{ |
{ |
size_t slen; |
size_t slen; |
int comment; |
int iscomment; |
|
|
slen = strlen(s); |
slen = strlen(s); |
/* Is line shorter than string? */ |
/* Is line shorter than string? */ |
|
|
/* Does line contain anything but comments and whitespace? */ |
/* Does line contain anything but comments and whitespace? */ |
line += slen; |
line += slen; |
linelen -= slen; |
linelen -= slen; |
comment = 0; |
iscomment = 0; |
while (linelen) { |
while (linelen) { |
if (comment) { |
if (iscomment) { |
if (*line == '>') |
if (*line == '>') |
comment = 0; |
iscomment = 0; |
} else if (*line == '<') |
} else if (*line == '<') |
comment = 1; |
iscomment = 1; |
else if (!isspace((unsigned char)*line)) |
else if (!isspace((unsigned char)*line)) |
return (1); |
return (1); |
++line; |
++line; |
|
|
fprintf(fp, ">Originator:\t%s\n", fullname); |
fprintf(fp, ">Originator:\t%s\n", fullname); |
fprintf(fp, ">Organization:\n"); |
fprintf(fp, ">Organization:\n"); |
fprintf(fp, "net\n"); |
fprintf(fp, "net\n"); |
fprintf(fp, ">Synopsis:\t<synopsis of the problem (one line)>\n"); |
fprintf(fp, ">Synopsis:\t%s\n", comment[0]); |
fprintf(fp, ">Severity:\t" |
fprintf(fp, ">Severity:\t%s\n", comment[1]); |
"<[ non-critical | serious | critical ] (one line)>\n"); |
fprintf(fp, ">Priority:\t%s\n", comment[2]); |
fprintf(fp, ">Priority:\t<[ low | medium | high ] (one line)>\n"); |
fprintf(fp, ">Category:\t%s\n", comment[3]); |
fprintf(fp, ">Category:\t<PR category (one line)>\n"); |
fprintf(fp, ">Class:\t\t%s\n", comment[4]); |
fprintf(fp, ">Class:\t\t" |
fprintf(fp, ">Release:\t%s\n", comment[5]); |
"<[ sw-bug | doc-bug | change-request | support ] (one line)>\n"); |
|
fprintf(fp, ">Release:\t<release number or tag (one line)>\n"); |
|
fprintf(fp, ">Environment:\n"); |
fprintf(fp, ">Environment:\n"); |
fprintf(fp, "\t<machine, os, target, libraries (multiple lines)>\n"); |
fprintf(fp, "\t%s\n", comment[6]); |
fprintf(fp, "\tSystem : %s %s\n", os, rel); |
fprintf(fp, "\tSystem : %s %s\n", os, rel); |
fprintf(fp, "\tDetails : %s\n", details); |
fprintf(fp, "\tDetails : %s\n", details); |
fprintf(fp, "\tArchitecture: %s.%s\n", os, mach); |
fprintf(fp, "\tArchitecture: %s.%s\n", os, mach); |
fprintf(fp, "\tMachine : %s\n", mach); |
fprintf(fp, "\tMachine : %s\n", mach); |
fprintf(fp, ">Description:\n"); |
fprintf(fp, ">Description:\n"); |
fprintf(fp, "\t<precise description of the problem (multiple lines)>\n"); |
fprintf(fp, "\t%s\n", comment[7]); |
fprintf(fp, ">How-To-Repeat:\n"); |
fprintf(fp, ">How-To-Repeat:\n"); |
fprintf(fp, "\t<code/input/activities to reproduce the problem" |
fprintf(fp, "\t%s\n", comment[8]); |
" (multiple lines)>\n"); |
|
fprintf(fp, ">Fix:\n"); |
fprintf(fp, ">Fix:\n"); |
fprintf(fp, "\t<how to correct or work around the problem," |
fprintf(fp, "\t%s\n", comment[9]); |
" if known (multiple lines)>\n"); |
|
|
|
if (!Dflag) |
if (!Dflag) |
dmesg(fp); |
dmesg(fp); |