From de10339906da0beb5ddb61af36b0ff5a9073fee4 Mon Sep 17 00:00:00 2001 From: William Brown Date: Thu, 20 Oct 2016 17:58:31 +1000 Subject: [PATCH] Ticket 48272 - Fix compiler warnings for addn Bug Description: There were a number of warnings about const discard. Fix Description: Fix the types in addn.c to prevent the warnings. https://fedorahosted.org/389/ticket/48272 Author: wibrown Review by: ??? --- ldap/servers/plugins/addn/addn.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ldap/servers/plugins/addn/addn.c b/ldap/servers/plugins/addn/addn.c index e57edf9..3abc112 100644 --- a/ldap/servers/plugins/addn/addn.c +++ b/ldap/servers/plugins/addn/addn.c @@ -164,13 +164,13 @@ addn_prebind(Slapi_PBlock *pb) Slapi_Entry *domain_config = NULL; Slapi_DN *pb_sdn_target = NULL; Slapi_DN *pb_sdn_mapped = NULL; - const char *dn = NULL; + char *dn = NULL; - const char *dn_bind = NULL; + char *dn_bind = NULL; int dn_bind_len = 0; char *dn_bind_escaped = NULL; - const char *dn_domain = NULL; + char *dn_domain = NULL; int dn_domain_len = 0; char *dn_domain_escaped = NULL; @@ -188,7 +188,8 @@ addn_prebind(Slapi_PBlock *pb) slapi_log_err(SLAPI_LOG_PLUGIN, plugin_name, "addn_prebind: --> begin\n"); slapi_pblock_get(pb, SLAPI_BIND_TARGET_SDN, &pb_sdn_target); - dn = slapi_sdn_get_dn(pb_sdn_target); + /* We need to discard the const because later functions require char * only */ + dn = (char *)slapi_sdn_get_dn(pb_sdn_target); if (dn == NULL) { result = ADDN_FAILURE; goto out; -- 1.8.3.1