Skip to content

OVAL/probes: add missing header include - #2400

Merged
Mab879 merged 1 commit into
OpenSCAP:maint-1.3from
Tropicao:fix_build_failure
Aug 13, 2026
Merged

OVAL/probes: add missing header include#2400
Mab879 merged 1 commit into
OpenSCAP:maint-1.3from
Tropicao:fix_build_failure

Conversation

@Tropicao

Copy link
Copy Markdown
Contributor

Hello,
the Openscap integration in Buildroot tracks the 1.3 branch, and can fail to build due to a -Wimplicit-function-declaration warning being turned into error (see buildroot autobuilder logs for an example). This small PR aims to get rid of the warning breaking the build.

Openscap build can fail with the following log when
-Wimplicit-function-declaration is turned into an error:

In file included from [...]/src/OVAL/probes/unix/linux/systemdunitproperty_probe.c:38:
[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
      |                                                  ^~~~~~~~
      |                                                  rename
In file included from [...]/src/OVAL/probes/unix/linux/systemdunitdependency_probe.c:37:
[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
      |                                                  ^~~~~~~~
      |                                                  rename

Add the missing header include pointed by `man 3 basename` to fix the
error.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
@sonarqubecloud

Copy link
Copy Markdown

@Mab879
Mab879 merged commit 6391e6d into OpenSCAP:maint-1.3 Aug 13, 2026
11 checks passed
@Tropicao
Tropicao deleted the fix_build_failure branch August 13, 2026 18:35
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.

2 participants