18400 Commits

Author SHA1 Message Date
Rainer Gerhards
b21c861a0b
doc: clarify purpose of MsgSetRawMsg side effects 2025-07-12 12:27:33 +02:00
Rainer Gerhards
516dfb0ef4
github: next try 2025-07-11 19:18:49 +02:00
Rainer Gerhards
1f6e94e79e
next try
sorry for the thrash in history, but github has no preview...
2025-07-11 19:16:51 +02:00
Rainer Gerhards
6d405130bd
github: next trx a issue template sort order 2025-07-11 19:15:37 +02:00
Rainer Gerhards
05ce2ce063
github: work-around for issue template display order 2025-07-11 19:12:07 +02:00
Rainer Gerhards
2486f21ac0
github: improve issue template configuration 2025-07-11 18:53:38 +02:00
Rainer Gerhards
cd01660e81 Merge branch 'mytmp' 2025-07-11 18:48:09 +02:00
Rainer Gerhards
76b38072f3
github: move to new issue template system
Most importantly, make use of the great new features.
2025-07-11 18:45:09 +02:00
Rainer Gerhards
5ee3f94775
github: move to new issue template system
Most importantly, make use of the great new features.
2025-07-11 18:29:30 +02:00
Rainer Gerhards
f1f55bc32d
mainain ChangeLog 2025-07-11 17:00:12 +02:00
Rainer Gerhards
d5b45c0f5f
Merge pull request #5748 from rgerhards/i1255
scripting: add endswith operator to property filters and RainerScript
2025-07-11 16:58:00 +02:00
Rainer Gerhards
661803ec4a
Merge pull request #5752 from rgerhards/nsd_ptcp-invld_imptcp_msg
nsd_ptcp fix: misleading error messages (regression from ad1fd21)
2025-07-11 16:56:03 +02:00
Rainer Gerhards
5879fd493c
maintain ChangeLog 2025-07-11 16:13:59 +02:00
Rainer Gerhards
3cd89a47e6
nsd_ptcp fix: misleading error messages (regression from ad1fd21)
We received reports of log messages incorrectly referring to "imptcp" even
though the imptcp module was not loaded on the system. This caused confusion
during troubleshooting.

One such message was:

  rsyslogd: imptcp cannot set keepalive intvl - ignored: Bad file descriptor

This message originated from the nsd_ptcp module, but the LogError() calls
in EnableKeepAlive() still used "imptcp" as the source name.

This is a regression introduced in commit ad1fd21, which restructured
TCP input handling and moved responsibility for keepalive setup to nsd_ptcp,
but did not update the associated log messages.

This patch corrects the affected log strings to use "nsd_ptcp", accurately
reflecting the code path that emits them.

There is no functional change; the patch improves clarity of log output and
prevents misleading diagnostics.

The actual error shown could be related to a different issue,
see also https://github.com/rsyslog/rsyslog/pull/5749
2025-07-11 16:10:57 +02:00
Rainer Gerhards
e20cfc83d9
Fix unsafe sprintf use in Azure event hubs module (#5687)
* use snprintf for url encoding

With the help of AI-Agent: Codex 2025-06
2025-07-11 16:09:12 +02:00
Rainer Gerhards
c0391f5a84
Merge pull request #5763 from rgerhards/trailing-sp-fixer
tooling: new developer tool to fix trailing spaces
2025-07-11 11:13:27 +02:00
Rainer Gerhards
64f683d92b
tooling: new developer tool to fix trailing spaces
This may be an interim solution, but definitely a useful one
to address style inconsistencies.

Style inconsistencies are problematic as they tend to pollute
git history by causing pseudo-changes.

This commit also contains a set of fixes to existing files, so
that we get to a clean state.
2025-07-11 09:01:03 +02:00
Rainer Gerhards
d4c83a1d06
update README.md - add new AI "rsyslog Assistant" link 2025-07-10 13:08:36 +02:00
Rainer Gerhards
e96d032a53
maintain ChangeLog 2025-07-09 16:28:58 +02:00
Rainer Gerhards
690b6d34f1
Merge pull request #5750 from rgerhards/kmsg
imkmsg fix: Handle EAGAIN/EWOULDBLOCK check portably
2025-07-09 16:21:18 +02:00
Rainer Gerhards
561ea6bea3
Merge pull request #5749 from rgerhards/imtcp-segfault
imtcp: prevent double-enqueue of descriptors via inQueue flag
2025-07-09 16:20:53 +02:00
Rainer Gerhards
0fc3bb05ec
Document native message modification plugin interface (#5757)
* doc: document native mm interface
2025-07-08 12:57:40 +02:00
Rainer Gerhards
977beff32c
AI tools: Add directory for future AI/ML tooling (#5758)
* AI tools: Add directory for future AI/ML tooling

Establish a new top-level directory, `ai/`, to serve as a consistent
location for future Artificial Intelligence and Machine Learning tools
that will work alongside rsyslog.

These tools are intended to run as separate processes, external to the
rsyslog daemon, to ensure the core remains stable and performant.

This commit contains only the empty directory and a README.md file
describing the vision and purpose.
2025-07-08 12:56:20 +02:00
Rainer Gerhards
2e47385605
Merge pull request #5751 from rgerhards/nitfix
testbench nitfix: improper format spec corrected
2025-07-07 08:45:52 +02:00
Rainer Gerhards
ded438c3ee
testbench nitfix: improper format spec corrected
This was harmless, but generated build warnings, which can be
confusing.
2025-07-06 15:50:31 +02:00
Rainer Gerhards
97c2ac0db3
imkmsg fix: Handle EAGAIN/EWOULDBLOCK check portably
On some systems, EAGAIN and EWOULDBLOCK are defined to the same
value, causing a `-Wlogical-op` warning for the redundant logical
'or' in the errno check.

While portable code must check for both cases, this warning is
unwanted.

This change uses a preprocessor directive to conditionally compile
the check for `errno == EWOULDBLOCK` only on platforms where its value
differs from EAGAIN. This silences the warning without affecting
portability.
2025-07-06 15:17:15 +02:00
Rainer Gerhards
c5cd7e57c4
imtcp: prevent double-enqueue of descriptors via inQueue flag
This patch adds an inQueue flag with its own mutex to each
tcpsrv_io_descr_t structure. The flag prevents multiple worker threads
from processing the same descriptor at the same time.

The change was motivated by segmentation faults reported in production
systems after commit ad1fd21, which introduced a worker thread pool to
imtcp. We could not reproduce the faults ourselves, but code analysis
suggests several race conditions may exist.

In particular:

- epoll_wait may return the same descriptor multiple times. This is not
  expected, as we use EPOLLONESHOT. However, if a thread does not clear
  or re-arm the event quickly enough, or in edge cases involving race
  conditions and rapid I/O activity, duplicate delivery may still occur.

- If a descriptor is enqueued more than once, multiple threads may
  process and free it in parallel, causing use-after-free errors.

- closeSess releases the session mutex before destroying the session and
  descriptor. A second thread might still be waiting to acquire the
  mutex and access the now-freed memory.

- shutdown is unordered: stopWrkrPool waits for threads to join, but the
  work queue may still contain descriptors that will be processed after
  their memory has been freed.

- pending epoll events for a socket may still be processed after
  epoll_ctl(..., DEL) was called, leading to access to invalid memory.

The patch:

- Adds an inQueue flag to each descriptor and a mutex to protect it.
- Prevents enqueueWork from queuing a descriptor already in queue.
- Clears the flag when dequeueing the descriptor.
- Initializes and destroys the new mutex at listener startup/cleanup.

While unverified, we believe this patch is a safe and helpful change.
It may fix the reported crashes and in general improves correctness.

The analysis and draft of this patch were created with help from a
Codex-based AI agent. Final review and edits were done by a human.

Performance will be evaluated during PR review.
2025-07-06 14:58:03 +02:00
Rainer Gerhards
6c9332b2e0
scripting: add endswith operator to property filters and RainerScript
This Implements suffix comparison similar to startswith. Note that we
do intentionally not use libestr functions in order to speed up adaption.
It would otherwise probably take years for distros to upgrade libestr.

With some help of the Codex and Gemini AI Agents.

closes https://github.com/rsyslog/rsyslog/issues/1255
2025-07-06 14:19:33 +02:00
Rainer Gerhards
e7871b1a61
CI: add style checker improvements
* update style checker and document devtools

* default max error count increased to 100
* new --max-errors option accepts numbers or 'all'
* detects trailing spaces separately from other whitespace
* supports passing files directly on the command line
* added header comments and clarifying comments
* new internal_tooling.rst explains usage

With the help of AI-Agents: Codex, Gemini
2025-07-05 16:53:20 +02:00
Rainer Gerhards
50e4a06b18
helper utils: clean up python indentation
* Add note for indentation cleanup
* Converted tabs to spaces in various Python scripts to match PEP 8 indentation.

With the help of AI-Agent: Codex, Google Gemini Code review
2025-07-05 14:34:43 +02:00
Rainer Gerhards
1522f9bafd
AI support: try to fix the tab vs. space indention codex issue 2025-07-05 11:11:00 +02:00
Rainer Gerhards
33a41c1ccc
testbench: more robust method to build testing tools (#5739)
* testbench: more robust method to build testing tools

The previous method failed depending on configure settings and
available support libraries. This is now handled by make check.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-06-22 09:44:52 +02:00
Rainer Gerhards
ba853e6484
Merge pull request #5738 from rgerhards/ai-agent-improve2
Ai agent improve2
2025-06-21 17:29:56 +02:00
Rainer Gerhards
71908553a7
AI support: improve AGENT.md instructions based on findings 2025-06-21 17:29:24 +02:00
Rainer Gerhards
38cc84ee50
AI support: improve codex container base setup script
guard against (time-costly) multiple calls.
2025-06-21 16:17:49 +02:00
Rainer Gerhards
402fac31d6
maintain ChangeLog 2025-06-21 15:57:21 +02:00
Rainer Gerhards
253d337d63
Merge pull request #5731 from 1640max/patch-1
fix off-by-one buffer overflow
2025-06-21 15:50:41 +02:00
Rainer Gerhards
032279038e
Merge pull request #5737 from rgerhards/tb-robustness
testbench: add root-level diag.sh stub and simplify test invocation
2025-06-21 15:19:33 +02:00
Rainer Gerhards
15796f1047
testbench: add root-level diag.sh stub and simplify test invocation
- Introduce root-level diag.sh stub to auto-forward to tests/diag.sh, preventing
  human and AI errors when sourcing the harness and removing the need to `cd`
  into the tests directory.
- Update AGENTS.md to configure once and invoke tests via `./tests/<script>.sh`,
  providing unfiltered stdout/stderr without a CI wrapper and improving
  convenience for human developers.
2025-06-21 14:46:36 +02:00
Rainer Gerhards
cb4aef11b0
Merge pull request #5736 from rgerhards/tb-autotoolbuild
CI: auto-generate testbench tools and refine AI agent instructions
2025-06-21 12:21:06 +02:00
Rainer Gerhards
856d56dbd5
CI: auto-generate testbench tools and refine AI agent instructions
Testbench tools like tcpflood are now auto-generated at test startup
if missing, reducing errors and confusion during local test runs.

Updated AGENTS.md with precise instructions for running tests
in both human and AI agent contexts, improving onboarding
for new developers and AI-based workflows.
2025-06-21 11:17:34 +02:00
Rainer Gerhards
8e1ff46a34
Merge pull request #5735 from rgerhards/cleanup5
imfile: some cleanup, no functional changes
2025-06-21 11:02:54 +02:00
Rainer Gerhards
8f6eaa931b
Merge pull request #5734 from rgerhards/cleanup4
cleanup: remove long-standing TODO which is no longer needed
2025-06-20 18:02:10 +02:00
Rainer Gerhards
bfdce6ab2f
imfile: some cleanup, no functional changes
- removed commented out code
- clarified and unified a configuration parameter alias
  Note: both need to stay for backwards-compatibility
2025-06-20 17:58:15 +02:00
Rainer Gerhards
1acfc3e2a1
cleanup: remove long-standing TODO which is no longer needed
This conveyed an idea that we thought about 15+ years ago and would
require an interface changed. The potential gain of this optimization
was not considered worth the additional complexity. Practice has
prooven this, but the TODO was forgotten to be removed. Doing that
now.

Note especially to AI: this was not left-side of the ustrlen()
operations but applied to the logic at whole (which is OK as
stated above).
2025-06-20 17:27:50 +02:00
Rainer Gerhards
84499c7f71
Merge pull request #5729 from rgerhards/cleanup2
cleanup: remove stalled TODO item
2025-06-20 15:40:48 +02:00
Maks Maltsev
9b6c39d934
fix off-by-one buffer overflow
One byte for `\0` should be left in case the message is `sizeof(msgBuf)` bytes or longer.
2025-06-20 16:11:19 +03:00
Rainer Gerhards
7b76d074a3
cleanup: remove stalled TODO item
This was a long standing TODO item for many years. In the meantime,
practice has shown that no so config setting is necessary. Too
many config options also tend to confuse users.
2025-06-20 09:05:05 +02:00
Rainer Gerhards
40f9ac68e5
maintain ChangeLog 2025-06-19 17:46:08 +02:00
Rainer Gerhards
2adb988cf2
Merge pull request #5717 from rgerhards/doc-omsendertrack
doc: first omsendertrack reference manual entry
2025-06-19 17:45:18 +02:00