libselinux: mark security_context_t typedef as deprecated
PATCH 1/1 libselinux: mark security_context_t typedef as deprecated
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.
--- libselinux/include/selinux/selinux.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
libselinux/include/selinux/selinux.h +9 -1
@@ -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);
Signature · 1 line
2.26.1
Quoted 6 lines · Christian Göttsche
Follow-up of:
9eb9c9327563014ad6a807814e7975424642d5b9("Get rid ofsecurity_context_tand fix const declarations.")Use a wrapper macro, because swig does not accept typedef attributes.
Signed-off-by Christian Göttsche <[email protected]>
If nobody raises an objection, I will merge the patch tomorrow.
Thanks,
Nicolas
Quoted 34 lines
--- libselinux/include/selinux/selinux.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)libselinux/include/selinux/selinux.h +9
-2@@ -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
Am So., 26. Apr. 2020 um 20:14 Uhr schrieb Nicolas Iooss <[email protected]>:
Quoted 6 lines
Quoted 3 lines · Christian Göttsche
Follow-up of:
9eb9c9327563014ad6a807814e7975424642d5b9("Get rid ofsecurity_context_tand fix const declarations.")
Quoted 7 lines
Quoted 3 lines
Use a wrapper macro, because swig does not accept typedef attributes.
Signed-off-by Christian Göttsche <[email protected]>Acked-by Nicolas Iooss <[email protected]>If nobody raises an objection, I will merge the patch tomorrow.
Maybe this should be delayed after the deprecation patch series from William Roberts to match the same style;
e.g. this patch uses a helper macro.
I'll prepare an updated patch.
Quoted 15 lines · Christian Göttsche
Am So., 26. Apr. 2020 um 20:14 Uhr schrieb Nicolas Iooss <[email protected]>:
Quoted 12 lines
Quoted 6 lines · Christian Göttsche
Follow-up of:
9eb9c9327563014ad6a807814e7975424642d5b9("Get rid ofsecurity_context_tand fix const declarations.")Use a wrapper macro, because swig does not accept typedef attributes.
Signed-off-by Christian Göttsche <[email protected]>Acked-by Nicolas Iooss <[email protected]>
Quoted 7 lines
Quoted 1 line
If nobody raises an objection, I will merge the patch tomorrow.
Maybe this should be delayed after the deprecation patch series from William Roberts to match the same style;
e.g. this patch uses a helper macro.I'll prepare an updated patch.
I was just about to look at this and suggest the same thing. I didn't put a macro like this in selinux.h for the simple
reason that I didn't want to make it something considered public API. I avoided if SWIG, since its really
a gnuc extension that most compilers support, and its inline with the other extensions that get buy the
SWIG build.
I would nack it for those two reasons.
I just sent V4 of the series, so hopefully that one sticks. If you wan't you can update the style now and resubmit. As we can merge it in parallel to my series (there is no hard dependency), so you don't have to wait for my series to land.
PATCH v2 1/1 libselinux: mark security_context_t typedef as deprecated
In reply to Christian GöttscheFollow-up of: 9eb9c9327563014ad6a807814e7975424642d5b9 ("Get rid of security_context_t and fix const declarations.")
---
v2: use the common deprecation style
libselinux/include/selinux/selinux.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
libselinux/include/selinux/selinux.h +5 -1
@@ -14,7 +14,11 @@ extern int is_selinux_enabled(void);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 +#ifdef __GNUC__ +__attribute__ ((deprecated)) +#endif +;/* Free the memory allocated for a context by any of the below get* calls. */ extern void freecon (char * con);
Signature · 1 line
2.26.2
Quoted 34 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Christian Göttsche
Sent: Thursday, April 30, 2020 10:03 AM
To: [email protected]
Subject: [PATCH v2] libselinux: marksecurity_context_ttypedef as deprecatedFollow-up of:
9eb9c9327563014ad6a807814e7975424642d5b9("Get rid ofsecurity_context_tand fix const declarations.")Signed-off-by Christian Göttsche <[email protected]>---
v2: use the common deprecation stylelibselinux/include/selinux/selinux.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)libselinux/include/selinux/selinux.h +5
-0@@ -14,7 +14,11 @@ extern int is_selinux_enabled(void); extern intis_selinux_mls_enabled (void); /* No longer used; here for compatibility with legacy callers. */ -typedef char *security_context_t; +typedef char *security_context_t +#ifdef __GNUC__ +__attribute__ ((deprecated)) +#endif +;/* Free the memory allocated for a context by any of the below get* calls. */
Quoted 3 lines
extern void
freecon(char * con);
--
2.26.2
Quoted 33 lines
Quoted 33 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Christian Göttsche
Sent: Thursday, April 30, 2020 10:03 AM
To: [email protected]
Subject: [PATCH v2] libselinux: marksecurity_context_ttypedef as deprecatedFollow-up of:
9eb9c9327563014ad6a807814e7975424642d5b9("Get rid ofsecurity_context_tand fix const declarations.")Signed-off-by Christian Göttsche <[email protected]>---
v2: use the common deprecation stylelibselinux/include/selinux/selinux.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)libselinux/include/selinux/selinux.h +5
-0@@ -14,7 +14,11 @@ extern int is_selinux_enabled(void); extern intis_selinux_mls_enabled (void); /* No longer used; here for compatibility with legacy callers. */ -typedef char *security_context_t; +typedef char *security_context_t +#ifdef __GNUC__ +__attribute__ ((deprecated)) +#endif +;
Quoted 6 lines
Quoted 4 lines
libselinux/include/selinux/selinux.h +0
-0/* Free the memory allocated for a context by any of the below get* calls. */ extern void
freecon(char * con);
--
2.26.2Acked-by William Roberts <[email protected]>
Merged:
https://github.com/SELinuxProject/selinux/pull/233
Thanks