Skip to content

Commit

Permalink
libselinux/restorecon: Include <selinux/label.h>
Browse files Browse the repository at this point in the history
restorecon.h uses types defined in label.h, so it needs to include
label.h (or code using restorecon.h also needs to include label.h,
which is not practical).

Fixes:
  $ make DESTDIR=~/obj install > make.out
In file included from semanage_store.c:39:
/home/sdsmall/obj/usr/include/selinux/restorecon.h:137:52: error:
‘struct selabel_handle’ declared inside parameter list will not be
visible outside of this definition or declaration [-Werror]
  137 | extern void selinux_restorecon_set_sehandle(struct
selabel_handle *hndl);
      |                                                    ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:111: semanage_store.o] Error 1
make[1]: *** [Makefile:15: install] Error 2
make: *** [Makefile:40: install] Error 1

Signed-off-by: Vit Mojzis <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
  • Loading branch information
vmojzis authored and stephensmalley committed Jul 29, 2024
1 parent f398662 commit 7974aea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libselinux/include/selinux/restorecon.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _RESTORECON_H_
#define _RESTORECON_H_

#include <selinux/label.h>

#include <sys/types.h>
#include <stddef.h>
#include <stdarg.h>
Expand Down

0 comments on commit 7974aea

Please sign in to comment.