Re: [PATCH] libselinux: mark security_context_t typedef as deprecated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 20, 2020 at 1:47 PM Christian Göttsche
<cgzones@xxxxxxxxxxxxxx> wrote:
>
> Follow-up of: 9eb9c9327563014ad6a807814e7975424642d5b9 ("Get rid of security_context_t and fix const declarations.")
>
> Use a wrapper macro, because swig does not accept typedef attributes.
>
> Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>

Acked-by: Nicolas Iooss <nicolas.iooss@xxxxxxx>

If nobody raises an objection, I will merge the patch tomorrow.

Thanks,
Nicolas

> ---
>  libselinux/include/selinux/selinux.h | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h
> index 6a512b38..f88a0363 100644
> --- a/libselinux/include/selinux/selinux.h
> +++ b/libselinux/include/selinux/selinux.h
> @@ -8,13 +8,21 @@
>  extern "C" {
>  #endif
>
> +#ifndef _selinux_deprecated
> +#ifdef __GNUC__
> +#define _selinux_deprecated __attribute__ ((deprecated))
> +#else
> +#define _selinux_deprecated
> +#endif
> +#endif
> +
>  /* Return 1 if we are running on a SELinux kernel, or 0 otherwise. */
>  extern int is_selinux_enabled(void);
>  /* Return 1 if we are running on a SELinux MLS kernel, or 0 otherwise. */
>  extern int is_selinux_mls_enabled(void);
>
>  /* No longer used; here for compatibility with legacy callers. */
> -typedef char *security_context_t;
> +typedef char *security_context_t _selinux_deprecated;
>
>  /* Free the memory allocated for a context by any of the below get* calls. */
>  extern void freecon(char * con);
> --
> 2.26.1
>




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux