diff mbox series

[15/17] avc_open: mark allowed use of avc_init

Message ID 20200225200219.6163-16-william.c.roberts@intel.com (mailing list archive)
State Changes Requested
Headers show
Series [01/17] security_load_booleans: update return comment | expand

Commit Message

William Roberts Feb. 25, 2020, 8:02 p.m. UTC
From: William Roberts <william.c.roberts@intel.com>

avc_init is deprecated, however avc_open internally uses it.
Mark this deprecated use as OK. Another approach could be to
define an avc_init2 as a hidden, internal symbol and call that, but this
was seemed simpler and clear.

Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
 libselinux/src/avc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libselinux/src/avc.c b/libselinux/src/avc.c
index 5230efd2323a..7d30f0052f7c 100644
--- a/libselinux/src/avc.c
+++ b/libselinux/src/avc.c
@@ -156,8 +156,10 @@  int avc_open(struct selinux_opt *opts, unsigned nopts)
 			avc_enforcing = !!opts[nopts].value;
 			break;
 		}
-
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 	return avc_init("avc", NULL, NULL, NULL, NULL);
+#pragma GCC diagnostic pop
 }
 
 int avc_init(const char *prefix,