From 9eb9c9327563014ad6a807814e7975424642d5b9 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Wed, 19 Feb 2014 09:16:17 -0500 Subject: Get rid of security_context_t and fix const declarations. In attempting to enable building various part of Android with -Wall -Werror, we found that the const security_context_t declarations in libselinux are incorrect; const char * was intended, but const security_context_t translates to char * const and triggers warnings on passing const char * from the caller. Easiest fix is to replace them all with const char *. And while we are at it, just get rid of all usage of security_context_t itself as it adds no value - there is no true encapsulation of the security context strings and callers already directly use string functions on them. typedef left to permit building legacy users until such a time as all are updated. This is a port of Change-Id I2f9df7bb9f575f76024c3e5f5b660345da2931a7 from Android, augmented to deal with all of the other code in upstream libselinux and updating the man pages too. Signed-off-by: Stephen Smalley Acked-by: Eric Paris --- libselinux/utils/getdefaultcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libselinux/utils/getdefaultcon.c') diff --git a/libselinux/utils/getdefaultcon.c b/libselinux/utils/getdefaultcon.c index 42f45988..c6f71516 100644 --- a/libselinux/utils/getdefaultcon.c +++ b/libselinux/utils/getdefaultcon.c @@ -19,7 +19,7 @@ static void usage(const char *name, const char *detail, int rc) int main(int argc, char **argv) { - security_context_t usercon = NULL, cur_context = NULL; + char * usercon = NULL, *cur_context = NULL; char *user = NULL, *level = NULL, *role=NULL, *seuser=NULL, *dlevel=NULL; char *service = NULL; int ret, opt; -- cgit v1.2.3