Skip to content

Commit adbf372

Browse files
jasonishvictorjulien
authored andcommitted
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 468a13e)
1 parent 1ce945e commit adbf372

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/builds.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,10 @@ jobs:
13361336
- run: make install-headers
13371337
- run: make install-library
13381338

1339+
- run: TZ="UTC" ./src/suricata -u -U LogCustomFormatTest01
1340+
- run: TZ="Brazil/East" ./src/suricata -u -U LogCustomFormatTest01
1341+
- run: TZ="Saskatchewan/Regina" ./src/suricata -u -U LogCustomFormatTest01
1342+
13391343
ubuntu-24-04-rust-vars:
13401344
name: Ubuntu 24.04 (RUSTC+CARGO vars)
13411345
runs-on: ubuntu-latest

src/log-cf-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static int LogCustomFormatTest01(void)
245245
tm.tm_year = 114;
246246
tm.tm_wday = 1;
247247
tm.tm_yday = 13;
248-
tm.tm_isdst = 0;
248+
tm.tm_isdst = -1;
249249
SCTime_t ts = SCTIME_FROM_SECS(mktime(&tm));
250250

251251
MemBuffer *buffer = MemBufferCreateNew(62);

0 commit comments

Comments
 (0)