crux-musl

Unnamed repository; edit this file 'description' to name the repository.
git clone https://codeberg.org/emmett1/crux-musl
Log | Files | Refs | README | LICENSE

0031-syslogd-fix-wrong-OPT_locallog-flag-detection.patch (1225B)


      1 From 3db0791a409be9b4c2f08cf3081d2d5141c3314c Mon Sep 17 00:00:00 2001
      2 From: Andrej Valek <andrej.v@skyrain.eu>
      3 Date: Wed, 16 Oct 2024 10:15:08 +0200
      4 Subject: [PATCH] syslogd: fix wrong OPT_locallog flag detection
      5 
      6 The OPT_locallog was set on "option_mask32" but checked on local
      7 "opts" variable. While this flag it's used on multiple places can't be
      8 has to be used with "option_mask32". Without this change syslogd
      9 is more-less unusable while no messages are logged locally.
     10 
     11 See:
     12 
     13 * https://lists.busybox.net/pipermail/busybox/2024-October/090969.html
     14 * https://lists.busybox.net/pipermail/busybox/2023-September/090499.html
     15 
     16 Signed-off-by: Andrej Valek <andrej.v@skyrain.eu>
     17 ---
     18  sysklogd/syslogd.c | 2 +-
     19  1 file changed, 1 insertion(+), 1 deletion(-)
     20 
     21 diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
     22 index 7558051f0..fa03aa280 100644
     23 --- a/sysklogd/syslogd.c
     24 +++ b/sysklogd/syslogd.c
     25 @@ -1179,7 +1179,7 @@ int syslogd_main(int argc UNUSED_PARAM, char **argv)
     26  			}
     27  		}
     28  #endif
     29 -		if (!ENABLE_FEATURE_REMOTE_LOG || (opts & OPT_locallog)) {
     30 +		if (!ENABLE_FEATURE_REMOTE_LOG || (option_mask32 & OPT_locallog)) {
     31  			recvbuf[sz] = '\0'; /* ensure it *is* NUL terminated */
     32  			split_escape_and_log(recvbuf, sz);
     33  		}