FreeBSD Bugzilla – Attachment 251206 Details for
Bug 279303
usr.sbin/newsyslog: Fix case of the 'P' flag in newsyslog.conf's manpage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH 1/2] Use uppercase for newsyslog.conf(5) flags parsing
0001-newsyslog-Use-uppercase-for-newsyslog.conf-5-flags-p.patch (text/plain), 3.44 KB, created by
Joshua Kinard
on 2024-06-03 23:38:38 UTC
(
hide
)
Description:
[PATCH 1/2] Use uppercase for newsyslog.conf(5) flags parsing
Filename:
MIME Type:
Creator:
Joshua Kinard
Created:
2024-06-03 23:38:38 UTC
Size:
3.44 KB
patch
obsolete
>From 49f4432913524028b2b85d3c334b6bbff51e586d Mon Sep 17 00:00:00 2001 >From: Joshua Kinard <freebsd@kumba.dev> >Date: Mon, 3 Jun 2024 14:27:19 -0400 >Subject: [PATCH 1/2] newsyslog: Use uppercase for newsyslog.conf(5) flags > parsing > >NetBSD switched to uppercase checks for the newsyslog.conf(5) >config flag parsing in late 2007 (hg commit e97bbfc29eff) when >it added the 'B' flag (CE_BINARY). To reduce code differential >between the two codebases, the same changes are made to FreeBSD. > >PR: 279303 >Signed-off-by: Joshua Kinard <freebsd@kumba.dev> >--- > usr.sbin/newsyslog/newsyslog.c | 38 +++++++++++++++++----------------- > 1 file changed, 19 insertions(+), 19 deletions(-) > >diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c >index e9b84bae342d..c5e6e3b1bd14 100644 >--- a/usr.sbin/newsyslog/newsyslog.c >+++ b/usr.sbin/newsyslog/newsyslog.c >@@ -318,7 +318,7 @@ static int parse_signal(const char *str); > #define isdigitch(Anychar) isdigit((u_char)(Anychar)) > #define isprintch(Anychar) isprint((u_char)(Anychar)) > #define isspacech(Anychar) isspace((u_char)(Anychar)) >-#define tolowerch(Anychar) tolower((u_char)(Anychar)) >+#define toupperch(Anychar) toupper((u_char)(Anychar)) > > int > main(int argc, char **argv) >@@ -1397,62 +1397,62 @@ parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, > } > > for (; q && *q && !isspacech(*q); q++) { >- switch (tolowerch(*q)) { >- case 'b': >+ switch (toupperch(*q)) { >+ case 'B': > working->flags |= CE_BINARY; > break; >- case 'c': >+ case 'C': > working->flags |= CE_CREATE; > break; >- case 'd': >+ case 'D': > working->flags |= CE_NODUMP; > break; >- case 'e': >+ case 'E': > working->flags |= CE_NOEMPTY; > break; >- case 'g': >+ case 'G': > working->flags |= CE_GLOB; > break; >- case 'j': >+ case 'J': > if (compress_type_override == COMPRESS_LEGACY) > working->compress = COMPRESS_BZIP2; > else > working->compress = compress_type_override; > compress_type_seen = true; > break; >- case 'n': >+ case 'N': > working->flags |= CE_NOSIGNAL; > break; >- case 'p': >+ case 'P': > working->flags |= CE_PLAIN0; > break; >- case 'r': >+ case 'R': > working->flags |= CE_PID2CMD; > break; >- case 't': >+ case 'T': > working->flags |= CE_RFC5424; > break; >- case 'u': >+ case 'U': > working->flags |= CE_SIGNALGROUP; > break; >- case 'w': >+ case 'W': > /* Deprecated flag - keep for compatibility purposes */ > break; >- case 'x': >+ case 'X': > if (compress_type_override == COMPRESS_LEGACY) > working->compress = COMPRESS_XZ; > else > working->compress = compress_type_override; > compress_type_seen = true; > break; >- case 'y': >+ case 'Y': > if (compress_type_override == COMPRESS_LEGACY) > working->compress = COMPRESS_ZSTD; > else > working->compress = compress_type_override; > compress_type_seen = true; > break; >- case 'z': >+ case 'Z': > if (compress_type_override == COMPRESS_LEGACY) > working->compress = COMPRESS_GZIP; > else >@@ -1461,8 +1461,8 @@ parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, > break; > case '-': > break; >- case 'f': /* Used by OpenBSD for "CE_FOLLOW" */ >- case 'm': /* Used by OpenBSD for "CE_MONITOR" */ >+ case 'F': /* Used by OpenBSD for "CE_FOLLOW" */ >+ case 'M': /* Used by OpenBSD for "CE_MONITOR" */ > default: > badline("illegal flag in config file -- %c", > *q); >-- >2.45.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 279303
:
250961
| 251206 |
251207