diff mbox series

[v2] selinux: make header files self-including

Message ID 20230512092157.41850-1-cgzones@googlemail.com (mailing list archive)
State Accepted
Delegated to: Paul Moore
Headers show
Series [v2] selinux: make header files self-including | expand

Commit Message

Christian Göttsche May 12, 2023, 9:21 a.m. UTC
Include all necessary headers in header files to enable third party
applications, like LSP servers, to resolve all used symbols.

ibpkey.h: include "flask.h" for SECINITSID_UNLABELED
initial_sid_to_string.h: include <linux/stddef.h> for NULL

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
v2:
    use raw flask.h instead of ../flask.h
    Link: https://lore.kernel.org/oe-kbuild-all/202305121044.Q88iF2NQ-lkp@intel.com/
---
 security/selinux/include/ibpkey.h                | 1 +
 security/selinux/include/initial_sid_to_string.h | 3 +++
 2 files changed, 4 insertions(+)

Comments

Paul Moore May 18, 2023, 6:14 p.m. UTC | #1
On May 12, 2023 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com> wrote:
> 
> Include all necessary headers in header files to enable third party
> applications, like LSP servers, to resolve all used symbols.
> 
> ibpkey.h: include "flask.h" for SECINITSID_UNLABELED
> initial_sid_to_string.h: include <linux/stddef.h> for NULL
> 
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
> v2:
>     use raw flask.h instead of ../flask.h
>     Link: https://lore.kernel.org/oe-kbuild-all/202305121044.Q88iF2NQ-lkp@intel.com/
> ---
>  security/selinux/include/ibpkey.h                | 1 +
>  security/selinux/include/initial_sid_to_string.h | 3 +++
>  2 files changed, 4 insertions(+)

Merged into selinux/next, thanks.

> diff --git a/security/selinux/include/ibpkey.h b/security/selinux/include/ibpkey.h
> index c992f83b0aae..875b055849e1 100644
> --- a/security/selinux/include/ibpkey.h
> +++ b/security/selinux/include/ibpkey.h
> @@ -15,6 +15,7 @@
>  #define _SELINUX_IB_PKEY_H
>  
>  #include <linux/types.h>
> +#include "flask.h"
>  
>  #ifdef CONFIG_SECURITY_INFINIBAND
>  void sel_ib_pkey_flush(void);
> diff --git a/security/selinux/include/initial_sid_to_string.h b/security/selinux/include/initial_sid_to_string.h
> index 60820517aa43..ecc6e74fa09b 100644
> --- a/security/selinux/include/initial_sid_to_string.h
> +++ b/security/selinux/include/initial_sid_to_string.h
> @@ -1,4 +1,7 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> +
> +#include <linux/stddef.h>
> +
>  static const char *const initial_sid_to_string[] = {
>  	NULL,
>  	"kernel",
> -- 
> 2.40.1

--
paul-moore.com
diff mbox series

Patch

diff --git a/security/selinux/include/ibpkey.h b/security/selinux/include/ibpkey.h
index c992f83b0aae..875b055849e1 100644
--- a/security/selinux/include/ibpkey.h
+++ b/security/selinux/include/ibpkey.h
@@ -15,6 +15,7 @@ 
 #define _SELINUX_IB_PKEY_H
 
 #include <linux/types.h>
+#include "flask.h"
 
 #ifdef CONFIG_SECURITY_INFINIBAND
 void sel_ib_pkey_flush(void);
diff --git a/security/selinux/include/initial_sid_to_string.h b/security/selinux/include/initial_sid_to_string.h
index 60820517aa43..ecc6e74fa09b 100644
--- a/security/selinux/include/initial_sid_to_string.h
+++ b/security/selinux/include/initial_sid_to_string.h
@@ -1,4 +1,7 @@ 
 /* SPDX-License-Identifier: GPL-2.0 */
+
+#include <linux/stddef.h>
+
 static const char *const initial_sid_to_string[] = {
 	NULL,
 	"kernel",