Repository navigation
Conversation
Apple's basename() uses a process-wide static buffer, so a threaded in_tail input can overwrite the pointer mid-compare and report a false rotation. Compare the suffix after the last path separator on the original strings instead. Fixes fluent#12780 Signed-off-by: kevin9327 <5299031+kevin9327@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
flb_tail_target_file_name_cmpcalled libcbasename()twice. On macOS (and some other libcs)basename()uses a process-wide static buffer, so a threadedin_tailinput can overwrite that buffer betweenbasename()andstrdup(), or duringstrcmp(), and then treat an unchanged file as rotated. That produces duplicate records.This replaces
basename()with a thread-safe scan for the last path separator (/and, on Windows,\) on the original strings, so no shared buffer or extra copies are involved. Windows still uses_stricmp.Fixes #12780
Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit