summaryrefslogtreecommitdiffstats
path: root/usr.bin/sendbug/sendbug.c
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2008-12-14 07:46:24 +0000
committerray <ray@openbsd.org>2008-12-14 07:46:24 +0000
commit22970bc835c3d615bf4c4ae6a4dd55b814a12085 (patch)
tree0d8583a37562840169a86d67c62635d183fd3e15 /usr.bin/sendbug/sendbug.c
parentGive names to anonymous unions. (diff)
downloadwireguard-openbsd-22970bc835c3d615bf4c4ae6a4dd55b814a12085.tar.xz
wireguard-openbsd-22970bc835c3d615bf4c4ae6a4dd55b814a12085.zip
Remove useless fields from template, they just serve to confuse
users. Idea okayed by art and deraadt, feedback from jmc.
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r--usr.bin/sendbug/sendbug.c63
1 files changed, 12 insertions, 51 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index bcbafb01115..2efa55f2ea9 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.58 2008/10/06 04:58:37 deraadt Exp $ */
+/* $OpenBSD: sendbug.c,v 1.59 2008/12/14 07:46:24 ray Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -39,17 +39,9 @@ int send_file(const char *, int);
int sendmail(const char *);
void template(FILE *);
-const char *categories = "system user library documentation kernel "
- "alpha amd64 arm hppa i386 m68k m88k mips64 powerpc sh sparc sparc64 vax";
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)>"
@@ -65,7 +57,7 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-DLPV]\n", __progname);
+ fprintf(stderr, "usage: %s [-DPV]\n", __progname);
exit(1);
}
@@ -87,15 +79,11 @@ main(int argc, char *argv[])
time_t mtime;
FILE *fp;
- while ((ch = getopt(argc, argv, "DLPV")) != -1)
+ while ((ch = getopt(argc, argv, "DPV")) != -1)
switch (ch) {
case 'D':
Dflag = 1;
break;
- case 'L':
- printf("Known categories:\n");
- printf("%s\n\n", categories);
- exit(0);
case 'P':
Pflag = 1;
break;
@@ -537,31 +525,21 @@ checkfile(const char *pathname)
{
FILE *fp;
size_t len;
- int category, class, priority, release, severity, synopsis;
+ int rval = 0;
char *buf;
if ((fp = fopen(pathname, "r")) == NULL) {
warn("%s", pathname);
return (0);
}
- category = class = priority = release = severity = synopsis = 0;
while ((buf = fgetln(fp, &len))) {
- if (matchline(">Category:", buf, len))
- category = 1;
- else if (matchline(">Class:", buf, len))
- class = 1;
- else if (matchline(">Priority:", buf, len))
- priority = 1;
- else if (matchline(">Release:", buf, len))
- release = 1;
- else if (matchline(">Severity:", buf, len))
- severity = 1;
- else if (matchline(">Synopsis:", buf, len))
- synopsis = 1;
+ if (matchline(">Synopsis:", buf, len)) {
+ rval = 1;
+ break;
+ }
}
fclose(fp);
- return (category && class && priority && release && severity &&
- synopsis);
+ return (rval);
}
void
@@ -571,41 +549,24 @@ template(FILE *fp)
fprintf(fp, "SENDBUG: Lines starting with `SENDBUG' will"
" be removed automatically.\n");
fprintf(fp, "SENDBUG:\n");
- fprintf(fp, "SENDBUG: Choose from the following categories:\n");
- fprintf(fp, "SENDBUG:\n");
- fprintf(fp, "SENDBUG: %s\n", categories);
- fprintf(fp, "SENDBUG:\n");
- fprintf(fp, "SENDBUG:\n");
fprintf(fp, "To: %s\n", "gnats@openbsd.org");
fprintf(fp, "Subject: \n");
fprintf(fp, "From: %s\n", pw->pw_name);
fprintf(fp, "Cc: %s\n", pw->pw_name);
fprintf(fp, "Reply-To: %s\n", pw->pw_name);
- fprintf(fp, "X-sendbug-version: %s\n", version);
- fprintf(fp, "\n");
fprintf(fp, "\n");
- fprintf(fp, ">Submitter-Id:\tnet\n");
- fprintf(fp, ">Originator:\t%s\n", fullname);
- fprintf(fp, ">Organization:\n");
- fprintf(fp, "net\n");
fprintf(fp, ">Synopsis:\t%s\n", comment[0]);
- fprintf(fp, ">Severity:\t%s\n", comment[1]);
- fprintf(fp, ">Priority:\t%s\n", comment[2]);
- fprintf(fp, ">Category:\t%s\n", comment[3]);
- fprintf(fp, ">Class:\t\t%s\n", comment[4]);
- fprintf(fp, ">Release:\t%s\n", comment[5]);
fprintf(fp, ">Environment:\n");
- fprintf(fp, "\t%s\n", comment[6]);
fprintf(fp, "\tSystem : %s %s\n", os, rel);
fprintf(fp, "\tDetails : %s\n", details);
fprintf(fp, "\tArchitecture: %s.%s\n", os, mach);
fprintf(fp, "\tMachine : %s\n", mach);
fprintf(fp, ">Description:\n");
- fprintf(fp, "\t%s\n", comment[7]);
+ fprintf(fp, "\t%s\n", comment[1]);
fprintf(fp, ">How-To-Repeat:\n");
- fprintf(fp, "\t%s\n", comment[8]);
+ fprintf(fp, "\t%s\n", comment[2]);
fprintf(fp, ">Fix:\n");
- fprintf(fp, "\t%s\n", comment[9]);
+ fprintf(fp, "\t%s\n", comment[3]);
if (!Dflag)
dmesg(fp);