Skip to content

audisp-syslog: include <unistd.h> for getppid() - #551

Merged
stevegrubb merged 1 commit into
linux-audit:masterfrom
itxaka-agent:audisp-syslog-include-unistd
Sep 14, 2026
Merged

stevegrubb merged 1 commit into
linux-audit:masterfrom
itxaka-agent:audisp-syslog-include-unistd

Conversation

@itxaka-agent

@itxaka-agent itxaka-agent commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Problem

audisp/plugins/syslog/audisp-syslog.c calls getppid() from its SIGTERM handler but never includes <unistd.h>.

On glibc the prototype leaks in via another header the plugin already pulls in, so the build stays quiet. On musl there is no such leak and the compile fails:

audisp-syslog.c: In function 'term_handler':
audisp-syslog.c: error: implicit declaration of function 'getppid'

Every sibling audisp plugin (af_unix, filter, ids, remote, statsd, zos-remote) already includes <unistd.h> for the same reason — this just matches them.

Downstream context

Hit while building audit-userspace 4.2.1 for Hadron Linux (musl-based minimal distro). Carrying the patch downstream, but the fix belongs upstream so every musl consumer stops hitting it.

audisp-syslog.c calls getppid() from its SIGTERM handler but never
includes <unistd.h>. glibc happens to expose the prototype through
another header the plugin already pulls in, so the build stays quiet
there. On musl the leak does not happen, and the compile fails with

    audisp-syslog.c: In function 'term_handler':
    audisp-syslog.c: error: implicit declaration of function 'getppid'

Every sibling audisp plugin (af_unix, filter, ids, remote, statsd,
zos-remote) already includes <unistd.h> for the same reason. Match
them.

Signed-off-by: itxaka-agent <itxaka-agent@users.noreply.github.com>

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka

Itxaka commented Sep 14, 2026

Copy link
Copy Markdown

PR was automated with agent but fix was done manually by me a human, as commented, while adding autdit to hadron I hit this issue.

@stevegrubb

Copy link
Copy Markdown
Contributor

Looks good. Thanks for the patch.

@stevegrubb
stevegrubb merged commit d95fef0 into linux-audit:master Sep 14, 2026
@Itxaka

Itxaka commented Sep 14, 2026

Copy link
Copy Markdown

Looks good. Thanks for the patch.

that was fast, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants