From adbf372bdd87a3c36f3f28578129cb722c515863 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 10 Mar 2026 13:33:43 -0600 Subject: [PATCH] log-cf-common: let mktime determine proper tz In some timezones, LogCustomFormatTest01 was failing as we were specifying the wrong setting for is_dst. Instead set it to -1 so mktime can make the decision based on the environment. Appears to fix this test for "Brazil/East" in the summer. Add GitHub CI tests to test this specific test with a few different timezones. (cherry picked from commit 468a13e0520e294764ec0c00329322b925f0313c) --- .github/workflows/builds.yml | 4 ++++ src/log-cf-common.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 06e5bf5d61..c80516fe7f 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -1336,6 +1336,10 @@ jobs: - run: make install-headers - run: make install-library + - run: TZ="UTC" ./src/suricata -u -U LogCustomFormatTest01 + - run: TZ="Brazil/East" ./src/suricata -u -U LogCustomFormatTest01 + - run: TZ="Saskatchewan/Regina" ./src/suricata -u -U LogCustomFormatTest01 + ubuntu-24-04-rust-vars: name: Ubuntu 24.04 (RUSTC+CARGO vars) runs-on: ubuntu-latest diff --git a/src/log-cf-common.c b/src/log-cf-common.c index 4d1c48b706..b1f504632f 100644 --- a/src/log-cf-common.c +++ b/src/log-cf-common.c @@ -245,7 +245,7 @@ static int LogCustomFormatTest01(void) tm.tm_year = 114; tm.tm_wday = 1; tm.tm_yday = 13; - tm.tm_isdst = 0; + tm.tm_isdst = -1; SCTime_t ts = SCTIME_FROM_SECS(mktime(&tm)); MemBuffer *buffer = MemBufferCreateNew(62);