Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setfiles.c:294:47: error: ‘SELINUX_RESTORECON_COUNT_ERRORS’ undeclared #368

Open
dilyanpalauzov opened this issue Aug 28, 2022 · 0 comments

Comments

@dilyanpalauzov
Copy link

Compiling selinux 3.4 prints:

make[2]: Entering directory '/src/selinux/selinux-3.4/policycoreutils/setfiles'
cc -O2 -Werror -Wall -Wextra -Wfloat-equal -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnull-dereference -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings -fno-common   -c -o setfiles.o setfiles.c
setfiles.c: In function ‘main’:
setfiles.c:294:47: error: ‘SELINUX_RESTORECON_COUNT_ERRORS’ undeclared (first use in this function); did you mean ‘SELINUX_RESTORECON_CONFLICT_ERROR’?
  294 |                         r_opts.count_errors = SELINUX_RESTORECON_COUNT_ERRORS;
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                               SELINUX_RESTORECON_CONFLICT_ERROR
setfiles.c:294:47: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [<builtin>: setfiles.o] Error 1
make[2]: Leaving directory '/src/selinux/selinux-3.4/policycoreutils/setfiles'

SELINUX_RESTORECON_COUNT_ERRORS is defined in the bundled libselinux/include/selinux/restorecon.h, but not in /usr/include/selinux/restorecon.h. The latter is from a previous version of selinux (probably 3.3).

The build command does not contain -I and then the path to the bundled include files. Therefore during build restorecon.h from a previous version of selinux are used.

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

No branches or pull requests

1 participant