From 2ca1478ad63bea46ce2d020e90d638cb56248d3c Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Tue, 30 Jul 2013 13:09:53 -0400
Subject: [PATCH] Ticket 47440 - Fix compilation warnings and header files

Original patches submitted by: 	lslebodn(Thanks!!)

https://fedorahosted.org/389/ticket/47440

Reviewed by: ?
---
 include/base/ereport.h                             |    4 ++--
 include/base/file.h                                |    2 +-
 include/i18n.h                                     |    6 +++---
 include/libaccess/acl.h                            |    4 ++--
 include/libaccess/aclerror.h                       |    2 +-
 include/libaccess/aclproto.h                       |    4 ++--
 include/libaccess/las.h                            |    2 +-
 include/libaccess/nsautherr.h                      |    2 +-
 include/libaccess/nserror.h                        |    2 +-
 include/libaccess/symbols.h                        |    4 ++--
 include/public/nsacl/aclapi.h                      |    9 +++++----
 include/public/nsacl/acldef.h                      |    2 +-
 .../plugins/posix-winsync/posix-group-func.c       |    4 +---
 .../plugins/replication/repl-session-plugin.h      |    4 ----
 ldap/servers/plugins/replication/winsync-plugin.h  |    4 ----
 ldap/servers/slapd/saslbind.c                      |   10 +++++++++-
 ldap/servers/slapd/slapi-plugin.h                  |   17 ++++++-----------
 lib/base/file.cpp                                  |    4 ++--
 lib/base/util.cpp                                  |   10 +++++-----
 lib/ldaputil/cert.c                                |   12 +++++++++---
 lib/libaccess/acl.tab.cpp                          |    2 +-
 lib/libaccess/aclerror.cpp                         |    4 ++--
 lib/libaccess/acleval.cpp                          |    4 ++--
 lib/libaccess/aclspace.cpp                         |    4 ++--
 lib/libaccess/acltext.y                            |    2 +-
 lib/libaccess/acltools.cpp                         |   10 +++++-----
 lib/libaccess/lasip.cpp                            |    8 ++++----
 lib/libaccess/nsautherr.cpp                        |   12 ++++++------
 lib/libaccess/oneeval.cpp                          |   12 ++++++------
 lib/libaccess/symbols.cpp                          |    4 ++--
 lib/libadmin/error.c                               |    2 +-
 lib/libsi18n/getstrprop.c                          |   12 ++++++------
 32 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/include/base/ereport.h b/include/base/ereport.h
index e97be14..40813ea 100644
--- a/include/base/ereport.h
+++ b/include/base/ereport.h
@@ -65,13 +65,13 @@ NSPR_BEGIN_EXTERN_C
  * the current date.
  */
 
-NSAPI_PUBLIC int INTereport(int degree, char *fmt, ...)
+NSAPI_PUBLIC int INTereport(int degree, const char *fmt, ...)
 #ifdef __GNUC__ 
         __attribute__ ((format (printf, 2, 3)));
 #else
         ;
 #endif
-NSAPI_PUBLIC int INTereport_v(int degree, char *fmt, va_list args);
+NSAPI_PUBLIC int INTereport_v(int degree, const char *fmt, va_list args);
 
 NSPR_END_EXTERN_C
 
diff --git a/include/base/file.h b/include/base/file.h
index fa53eb5..6ad9fc7 100644
--- a/include/base/file.h
+++ b/include/base/file.h
@@ -103,7 +103,7 @@ NSAPI_PUBLIC void INTfile_unix2local(char *path, char *p2);
 NSAPI_PUBLIC int INTsystem_nocoredumps(void);
 NSAPI_PUBLIC int INTfile_setinherit(SYS_FILE fd, int value);
 NSAPI_PUBLIC int INTfile_notfound(void);
-NSAPI_PUBLIC char *INTsystem_errmsg(void);
+NSAPI_PUBLIC const char *INTsystem_errmsg(void);
 NSAPI_PUBLIC int INTsystem_errmsg_fn(char **buff, size_t maxlen);
 
 NSPR_END_EXTERN_C
diff --git a/include/i18n.h b/include/i18n.h
index 2d53b20..d73e604 100644
--- a/include/i18n.h
+++ b/include/i18n.h
@@ -172,9 +172,9 @@ extern "C"
 /******************************/
 
 NSAPI_PUBLIC
-extern char*
-XP_GetStringFromDatabase(char* strLibraryName,
-                         char* strLanguage,
+extern const char*
+XP_GetStringFromDatabase(const char* strLibraryName,
+                         const char* strLanguage,
                          int iToken);
 
 #ifdef __cplusplus
diff --git a/include/libaccess/acl.h b/include/libaccess/acl.h
index c3f61ea..8242935 100644
--- a/include/libaccess/acl.h
+++ b/include/libaccess/acl.h
@@ -67,8 +67,8 @@
 
 NSPR_BEGIN_EXTERN_C
 
-extern	char	*generic_rights[];
-extern	char	*http_generic[];
+extern	const char	*generic_rights[];
+extern	const char	*http_generic[];
 
 NSPR_END_EXTERN_C
 
diff --git a/include/libaccess/aclerror.h b/include/libaccess/aclerror.h
index b8214b3..3aff2c7 100644
--- a/include/libaccess/aclerror.h
+++ b/include/libaccess/aclerror.h
@@ -45,7 +45,7 @@
 
 /* ACL facility name string (in aclbuild.c) */
 NSPR_BEGIN_EXTERN_C
-extern char * ACL_Program;
+extern const char * ACL_Program;
 NSPR_END_EXTERN_C
 
 /* Define error identifiers */
diff --git a/include/libaccess/aclproto.h b/include/libaccess/aclproto.h
index fe6545c..4579e8d 100644
--- a/include/libaccess/aclproto.h
+++ b/include/libaccess/aclproto.h
@@ -67,12 +67,12 @@ NSAPI_PUBLIC ACLExprHandle_t *ACL_ExprNew(const ACLExprType_t expr_type);
 NSAPI_PUBLIC void ACL_ExprDestroy(ACLExprHandle_t *expr);
 NSAPI_PUBLIC int ACL_ExprSetPFlags(NSErr_t *errp, ACLExprHandle_t *expr, PFlags_t flags);
 NSAPI_PUBLIC int ACL_ExprClearPFlags(NSErr_t *errp, ACLExprHandle_t *expr);
-NSAPI_PUBLIC int ACL_ExprTerm(NSErr_t *errp, ACLExprHandle_t *acl_expr, char *attr_name, CmpOp_t cmp, char *attr_pattern);
+NSAPI_PUBLIC int ACL_ExprTerm(NSErr_t *errp, ACLExprHandle_t *acl_expr, const char *attr_name, CmpOp_t cmp, char *attr_pattern);
 NSAPI_PUBLIC int ACL_ExprNot(NSErr_t *errp, ACLExprHandle_t *acl_expr);
 NSAPI_PUBLIC int ACL_ExprAnd(NSErr_t *errp, ACLExprHandle_t *acl_expr);
 NSAPI_PUBLIC int ACL_ExprOr(NSErr_t *errp, ACLExprHandle_t *acl_expr);
 NSAPI_PUBLIC int ACL_ExprAddAuthInfo(ACLExprHandle_t *expr, PList_t auth_info);
-NSAPI_PUBLIC int ACL_ExprAddArg(NSErr_t *errp, ACLExprHandle_t *expr, char *arg);
+NSAPI_PUBLIC int ACL_ExprAddArg(NSErr_t *errp, ACLExprHandle_t *expr, const char *arg);
 NSAPI_PUBLIC int ACL_ExprSetDenyWith(NSErr_t *errp, ACLExprHandle_t *expr, char *deny_type, char *deny_response);
 NSAPI_PUBLIC int ACL_ExprGetDenyWith(NSErr_t *errp, ACLExprHandle_t *expr, char **deny_type, char **deny_response);
 
diff --git a/include/libaccess/las.h b/include/libaccess/las.h
index 2e5673d..f2f4f33 100644
--- a/include/libaccess/las.h
+++ b/include/libaccess/las.h
@@ -74,7 +74,7 @@ struct ACLAttrGetter {
 NSPR_BEGIN_EXTERN_C
 
 NSAPI_PUBLIC extern int
-	ACL_LasRegister(NSErr_t *errp, char *attr_name, LASEvalFunc_t
+	ACL_LasRegister(NSErr_t *errp, const char *attr_name, LASEvalFunc_t
 	eval_func, LASFlushFunc_t flush_func);
 NSAPI_PUBLIC extern int
 	ACL_LasFindEval(NSErr_t *errp, char *attr_name, LASEvalFunc_t
diff --git a/include/libaccess/nsautherr.h b/include/libaccess/nsautherr.h
index 325e037..2e36fce 100644
--- a/include/libaccess/nsautherr.h
+++ b/include/libaccess/nsautherr.h
@@ -120,7 +120,7 @@
 NSPR_BEGIN_EXTERN_C
 
 /* Authentication facility name in nsuser.c */
-extern char * NSAuth_Program;
+extern const char * NSAuth_Program;
 
     /* Functions in nsautherr.c */
 extern NSAPI_PUBLIC void nsadbErrorFmt(NSErr_t * errp,
diff --git a/include/libaccess/nserror.h b/include/libaccess/nserror.h
index f6b5ef2..c03ca7c 100644
--- a/include/libaccess/nserror.h
+++ b/include/libaccess/nserror.h
@@ -71,7 +71,7 @@ extern void nserrDispose(NSErr_t * errp);
 extern NSEFrame_t * nserrFAlloc(NSErr_t * errp);
 extern void nserrFFree(NSErr_t * errp, NSEFrame_t * efp);
 extern NSEFrame_t * nserrGenerate(NSErr_t * errp, long retcode, long errorid,
-				  char * program, int errc, ...);
+				  const char * program, int errc, ...);
 
 /* Functions in nserrmsg.c */
 extern char * nserrMessage(NSEFrame_t * efp, int flags);
diff --git a/include/libaccess/symbols.h b/include/libaccess/symbols.h
index 73d04a4..f56b934 100644
--- a/include/libaccess/symbols.h
+++ b/include/libaccess/symbols.h
@@ -97,7 +97,7 @@ static void symFreeTable(void * pool, void * item);
 
 typedef struct Symbol_s Symbol_t;
 struct Symbol_s {
-    char * sym_name;			/* pointer to symbol name string */
+    const char * sym_name;			/* pointer to symbol name string */
     int sym_type;			/* symbol type */
     void *sym_data;			/* symbol data storage */
 };
@@ -127,7 +127,7 @@ extern void symTableEnumerate(void * table, void * argp,
                               int (*func)(Symbol_t * sym, void * parg));
 #endif /* UnixWare */
 
-extern int symTableFindSym(void * table, char * symname,
+extern int symTableFindSym(void * table, const char * symname,
 			   int symtype, void **psymref);
 extern int symTableNew(void **ptable);
 
diff --git a/include/public/nsacl/aclapi.h b/include/public/nsacl/aclapi.h
index 617cabf..3b2f641 100644
--- a/include/public/nsacl/aclapi.h
+++ b/include/public/nsacl/aclapi.h
@@ -78,7 +78,7 @@ struct ACLDispatchVector {
     NSEFrame_t *(*f_nserrFAlloc)(NSErr_t * errp);
     void (*f_nserrFFree)(NSErr_t * errp, NSEFrame_t * efp);
     NSEFrame_t *(*f_nserrGenerate)(NSErr_t * errp, long retcode,
-                                   long errorid, char * program,
+                                   long errorid, const char * program,
                                    int errc, ...);
 
     /* Property list support 
@@ -117,7 +117,7 @@ struct ACLDispatchVector {
 
     /* ACL attribute handling */
 
-    int (*f_ACL_LasRegister)(NSErr_t *errp, char *attr_name,
+    int (*f_ACL_LasRegister)(NSErr_t *errp, const char *attr_name,
                              LASEvalFunc_t eval_func,
                              LASFlushFunc_t flush_func);
 
@@ -202,12 +202,13 @@ struct ACLDispatchVector {
                                ACLExprHandle_t *expr, PFlags_t flags);
     int (*f_ACL_ExprClearPFlags)(NSErr_t *errp, ACLExprHandle_t *expr);
     int (*f_ACL_ExprTerm)(NSErr_t *errp, ACLExprHandle_t *acl_expr,
-                          char *attr_name, CmpOp_t cmp, char *attr_pattern);
+                          const char *attr_name, CmpOp_t cmp,
+                          char *attr_pattern);
     int (*f_ACL_ExprNot)(NSErr_t *errp, ACLExprHandle_t *acl_expr);
     int (*f_ACL_ExprAnd)(NSErr_t *errp, ACLExprHandle_t *acl_expr);
     int (*f_ACL_ExprOr)(NSErr_t *errp, ACLExprHandle_t *acl_expr);
     int (*f_ACL_ExprAddAuthInfo)(ACLExprHandle_t *expr, PList_t auth_info);
-    int (*f_ACL_ExprAddArg)(NSErr_t *errp, ACLExprHandle_t *expr, char *arg);
+    int (*f_ACL_ExprAddArg)(NSErr_t *errp, ACLExprHandle_t *expr, const char *arg);
     int (*f_ACL_ExprSetDenyWith)(NSErr_t *errp, ACLExprHandle_t *expr,
                                  char *deny_type, char *deny_response);
     int (*f_ACL_ExprGetDenyWith)(NSErr_t *errp, ACLExprHandle_t *expr,
diff --git a/include/public/nsacl/acldef.h b/include/public/nsacl/acldef.h
index b3e9f4d..dd2846f 100644
--- a/include/public/nsacl/acldef.h
+++ b/include/public/nsacl/acldef.h
@@ -429,7 +429,7 @@ typedef struct ldap LDAP;
 
 #ifdef	ALLOCATE_ATTR_TABLE
 /* Must be in the same order as the index numbers */
-char	*ACLAttrTable[] = {
+const char	*ACLAttrTable[] = {
 		 NULL,				/*  0 */
 /* Don't have one numbered 0 */
 		 ACL_ATTR_GROUP,		/*  1 */
diff --git a/ldap/servers/plugins/posix-winsync/posix-group-func.c b/ldap/servers/plugins/posix-winsync/posix-group-func.c
index 7e069be..664d637 100644
--- a/ldap/servers/plugins/posix-winsync/posix-group-func.c
+++ b/ldap/servers/plugins/posix-winsync/posix-group-func.c
@@ -17,11 +17,9 @@
 
  $Id: posix-group-func.c 28 2011-05-13 14:35:29Z grzemba $
  */
-#include "slapi-plugin.h"
-#include "slapi-private.h"
-
 #include <string.h>
 #include <nspr.h>
+#include "slapi-plugin.h"
 #include "posix-wsp-ident.h"
 
 #define MAX_RECURSION_DEPTH (5)
diff --git a/ldap/servers/plugins/replication/repl-session-plugin.h b/ldap/servers/plugins/replication/repl-session-plugin.h
index 1c684af..4e624f6 100644
--- a/ldap/servers/plugins/replication/repl-session-plugin.h
+++ b/ldap/servers/plugins/replication/repl-session-plugin.h
@@ -37,10 +37,6 @@
 #ifndef REPL_SESSION_PLUGIN_PUBLIC_API
 #define REPL_SESSION_PLUGIN_PUBLIC_API
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 #include "slapi-plugin.h"
 
 /*
diff --git a/ldap/servers/plugins/replication/winsync-plugin.h b/ldap/servers/plugins/replication/winsync-plugin.h
index 0f3b757..1052207 100644
--- a/ldap/servers/plugins/replication/winsync-plugin.h
+++ b/ldap/servers/plugins/replication/winsync-plugin.h
@@ -37,10 +37,6 @@
 #ifndef WINSYNC_PLUGIN_PUBLIC_API
 #define WINSYNC_PLUGIN_PUBLIC_API
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 /* windows_private.c */
 
 #include "slapi-plugin.h"
diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c
index 22e4fe2..96b1f8c 100644
--- a/ldap/servers/slapd/saslbind.c
+++ b/ldap/servers/slapd/saslbind.c
@@ -119,7 +119,12 @@ static Slapi_ComponentId *sasl_get_component_id()
  * entry from the internal database, at the same time we get any other
  * properties we need - it's more efficient that way.
  */
-static void ids_auxprop_lookup(void *glob_context,
+#if SASL_AUXPROP_PLUG_VERSION > 4
+static int ids_auxprop_lookup(
+#else
+static void ids_auxprop_lookup(
+#endif
+				  void *glob_context,
 				  sasl_server_params_t *sparams,
 				  unsigned flags,
 				  const char *user,
@@ -127,6 +132,9 @@ static void ids_auxprop_lookup(void *glob_context,
 {
     /* do nothing - we don't need auxprops - we just do this to avoid
        sasldb_auxprop_lookup */
+#if SASL_AUXPROP_PLUG_VERSION > 4
+    return 0;
+#endif
 }
 
 static sasl_auxprop_plug_t ids_auxprop_plugin = {
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index ecbf993..8309012 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -42,11 +42,6 @@
  *
  * END COPYRIGHT BLOCK */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-
 /*! \file slapi-plugin.h
  *  \brief Public Directory Server plugin interface.
  *         
@@ -2216,7 +2211,7 @@ int slapi_entry_apply_mod_extension(Slapi_Entry *e, const LDAPMod *mod, int modc
 /**
  * Invalidate all entries in the virtual attribute cache.
  */
-void slapi_entrycache_vattrcache_watermark_invalidate();
+void slapi_entrycache_vattrcache_watermark_invalidate(void);
 
 
 /*
@@ -3666,7 +3661,7 @@ void slapi_rand_array(void *randx, size_t len);
  * \see slapi_rand_r()
  * \see slapi_rand_array()
  */
-int slapi_rand();
+int slapi_rand(void);
 
 /**
  * Escape special characters in a search filter value
@@ -5035,7 +5030,7 @@ int slapi_attr_syntax_exists(const char *type);
  * \return \c 0 if the reload was successful.
  * \return non-0 if the reload failed.
  */
-int slapi_reload_internal_attr_syntax();
+int slapi_reload_internal_attr_syntax(void);
 
 /*
  * slapi_filter_apply() is used to apply a function to each simple filter
@@ -5309,7 +5304,7 @@ int slapi_apib_release(void **api);
 int slapi_td_init(int indexType);
 int slapi_td_set_val(int indexType, void *value);
 void slapi_td_get_val(int indexType, void **value);
-int slapi_td_dn_init();
+int slapi_td_dn_init(void);
 int slapi_td_set_dn(char *dn);
 void slapi_td_get_dn(char **dn);
 
@@ -5530,7 +5525,7 @@ char *slapi_err2string(int result);
  *
  * \return 1 if the server is shutting down
  */
-int slapi_is_shutting_down();
+int slapi_is_shutting_down(void);
 
 /*
  * checking routines for allocating and freeing memory
@@ -6360,7 +6355,7 @@ void slapi_destroy_task(void *arg);
 /* End of interface to support online tasks **********************************/
 
 /* Slapi_Counter Interface */
-Slapi_Counter *slapi_counter_new();
+Slapi_Counter *slapi_counter_new(void);
 void slapi_counter_init(Slapi_Counter *counter);
 void slapi_counter_destroy(Slapi_Counter **counter);
 PRUint64 slapi_counter_increment(Slapi_Counter *counter);
diff --git a/lib/base/file.cpp b/lib/base/file.cpp
index 6dc39e6..82a1852 100644
--- a/lib/base/file.cpp
+++ b/lib/base/file.cpp
@@ -613,7 +613,7 @@ with lmsg =strerror(errno);*/
     return msglen;
 }
 
-NSAPI_PUBLIC char *
+NSAPI_PUBLIC const char *
 system_errmsg(void)
 {
     char *buff = 0;
@@ -632,7 +632,7 @@ system_errmsg(void)
     }
     system_errmsg_fn(&buff, errbuf_size);
     if (buff == 0)
-        buff = "Could not retrieve system error message";
+        return "Could not retrieve system error message";
     return buff;
 }
 
diff --git a/lib/base/util.cpp b/lib/base/util.cpp
index 01f916d..164d1a0 100644
--- a/lib/base/util.cpp
+++ b/lib/base/util.cpp
@@ -232,19 +232,19 @@ static char sccsid[] = "@(#)strftime.c	5.11 (Berkeley) 2/24/91";
 #include <stdio.h>
 #endif
 
-static char *afmt[] = {
+static const char *afmt[] = {
 	"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
 };
-static char *Afmt[] = {
+static const char *Afmt[] = {
 	"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
 	"Saturday",
 };
 
-static char *bfmt[] = {
+static const char *bfmt[] = {
 	"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
 	"Oct", "Nov", "Dec",
 };
-static char *Bfmt[] = {
+static const char *Bfmt[] = {
 	"January", "February", "March", "April", "May", "June", "July",
 	"August", "September", "October", "November", "December",
 };
@@ -265,7 +265,7 @@ int
 util_strftime(char *pt, const char *format, const struct tm *t)
 {
     char *start = pt;
-	char *scrap;
+	const char *scrap;
 
 	for (; *format; ++format) {
 		if (*format == '%')
diff --git a/lib/ldaputil/cert.c b/lib/ldaputil/cert.c
index c26ff41..cc767fd 100644
--- a/lib/ldaputil/cert.c
+++ b/lib/ldaputil/cert.c
@@ -48,8 +48,9 @@
 #include <sec.h>
 */
 #include "prmem.h"
-#include "key.h"
-#include "cert.h"
+#include <key.h>
+#include <cert.h>
+#include <nss.h>
 #include <ldaputil/certmap.h>
 #include <ldaputil/errors.h>
 #include <ldaputil/cert.h>
@@ -285,7 +286,12 @@ _replaceAVA (char* attr, char** avas)
 }
 
 struct _attr_getter_pair {
-    char* (*getter) (CERTName* dn);
+#if NSS_VMAJOR < 3 || (NSS_VMAJOR == 3 && NSS_VMINOR < 15)
+    char* (*getter) ( CERTName* dn);
+#else
+    /* in 3.15.x "const" was added to the declarations */
+    char* (*getter) (const CERTName* dn);
+#endif
     const char* name1;
     const char* name2;
 } _attr_getter_table[] =
diff --git a/lib/libaccess/acl.tab.cpp b/lib/libaccess/acl.tab.cpp
index 27c8c1b..db4b0f5 100644
--- a/lib/libaccess/acl.tab.cpp
+++ b/lib/libaccess/acl.tab.cpp
@@ -179,7 +179,7 @@ acl_set_ip_dns(ACLExprHandle_t *expr, char **ip_dns)
 	int ii;
 	int jj;
 	int len;
-	char *attr;
+	const char *attr;
 	char *val;
 
         if (expr == NULL)
diff --git a/lib/libaccess/aclerror.cpp b/lib/libaccess/aclerror.cpp
index 8e94f64..7fadf33 100644
--- a/lib/libaccess/aclerror.cpp
+++ b/lib/libaccess/aclerror.cpp
@@ -76,8 +76,8 @@
 #define aclerrfail	XP_GetAdminStr(DBT_AclerrfmtAclerrfail)
 #define aclerrio	XP_GetAdminStr(DBT_AclerrfmtAclerrio)
 
-char * NSAuth_Program = "NSAUTH";
-char * ACL_Program = "NSACL";               /* ACL facility name */
+const char * NSAuth_Program = "NSAUTH";
+const char * ACL_Program = "NSACL";               /* ACL facility name */
 
 /*
  * Description (aclErrorFmt)
diff --git a/lib/libaccess/acleval.cpp b/lib/libaccess/acleval.cpp
index bf7a473..dde3487 100644
--- a/lib/libaccess/acleval.cpp
+++ b/lib/libaccess/acleval.cpp
@@ -72,9 +72,9 @@
 				!strcmp((rlm1)->rlm_dbname, \
 					(rlm2)->rlm_dbname))))
 
-int aclDNSLookup(DNSFilter_t * dnf, char * dnsspec, int fqdn, char **match)
+int aclDNSLookup(DNSFilter_t * dnf, const char * dnsspec, int fqdn, const char **match)
 {
-    char * subdns;		/* suffix of client DNS name */
+    const char * subdns;	/* suffix of client DNS name */
     void * table;		/* hash table pointer */
     Symbol_t * sym;		/* DNS spec symbol pointer */
     int rv;			/* result value */
diff --git a/lib/libaccess/aclspace.cpp b/lib/libaccess/aclspace.cpp
index a33c862..c9a1cfb 100644
--- a/lib/libaccess/aclspace.cpp
+++ b/lib/libaccess/aclspace.cpp
@@ -47,7 +47,7 @@
 #include	<libaccess/aclglobal.h>
 
 /* Ordered list of generic rights	*/
-char	*generic_rights[7] = {
+const char	*generic_rights[7] = {
 				"read",
 				"write",
 				"execute",
@@ -57,7 +57,7 @@ char	*generic_rights[7] = {
 				NULL
 			} ;
 
-char	*http_generic[7] = {
+const char	*http_generic[7] = {
 				"http_get, http_head, http_trace, http_revlog, http_options, http_copy, http_getattribute, http_index, http_getproperties, http_getattributenames ",
 				"http_put, http_mkdir, http_startrev, http_stoprev, http_edit, http_post, http_save, http_setattribute, http_revadd, http_revlabel, http_lock, http_unlock, http_unedit, http_stoprev, http_startrev",
 				"http_post",
diff --git a/lib/libaccess/acltext.y b/lib/libaccess/acltext.y
index 6ec9567..2019812 100644
--- a/lib/libaccess/acltext.y
+++ b/lib/libaccess/acltext.y
@@ -179,7 +179,7 @@ acl_set_ip_dns(ACLExprHandle_t *expr, char **ip_dns)
 	int ii;
 	int jj;
 	int len;
-	char *attr;
+	const char *attr;
 	char *val;
 
         if (expr == NULL)
diff --git a/lib/libaccess/acltools.cpp b/lib/libaccess/acltools.cpp
index 3ef2beb..0eb7387 100644
--- a/lib/libaccess/acltools.cpp
+++ b/lib/libaccess/acltools.cpp
@@ -229,7 +229,7 @@ ACL_AddPermInfo( NSErr_t *errp, ACLHandle_t *acl,
 NSAPI_PUBLIC int
 ACL_ExprAddArg( NSErr_t *errp, 
     ACLExprHandle_t *expr, 
-    char *arg )
+    const char *arg )
 {
 
     if ( expr == NULL ) 
@@ -406,7 +406,7 @@ acl_index_string ( int value, char *buffer )
  * displays ASCII equivalent of CmpOp_t
  */
 
-static char *
+static const char *
 acl_comp_string( CmpOp_t cmp )
 {
     switch (cmp) {
@@ -445,7 +445,7 @@ acl_comp_string( CmpOp_t cmp )
 
 NSAPI_PUBLIC int 
 ACL_ExprTerm( NSErr_t *errp, ACLExprHandle_t *acl_expr,
-        char *attr_name, 
+        const char *attr_name,
         CmpOp_t cmp, 
         char *attr_pattern )
 {
@@ -1381,7 +1381,7 @@ ACL_ParseString( NSErr_t *errp, char *buffer )
 ACLListHandle_t 	*handle = NULL;
 int			eid = 0;
 int			rv = 0;
-char			*errmsg;
+const char			*errmsg;
 
     ACL_InitAttr2Index();
 
@@ -1555,7 +1555,7 @@ ACL_ListGetNameList(NSErr_t *errp, ACLListHandle_t *acl_list, char ***name_list)
     int			list_size;
     char		**tmp_list;
     char		**local_list;
-    char		*name;
+    const char		*name;
     
 
     if ( acl_list == NULL )
diff --git a/lib/libaccess/lasip.cpp b/lib/libaccess/lasip.cpp
index e66f48a..f6d664a 100644
--- a/lib/libaccess/lasip.cpp
+++ b/lib/libaccess/lasip.cpp
@@ -69,7 +69,7 @@
 extern int LASIpGetIp();
 #endif
 
-static int colonhex_ipv6(char *ipstr, char *netmaskstr, PRIPv6Addr *ipv6, int *netmask);
+static int colonhex_ipv6(char *ipstr, const char *netmaskstr, PRIPv6Addr *ipv6, int *netmask);
 static int LASIpAddPattern(NSErr_t *errp, int netmask, int pattern, LASIpTree_t **treetop);
 static int LASIpAddPatternIPv6(NSErr_t *errp, int netmask, PRIPv6Addr *ipv6, LASIpTree_t **treetop);
 
@@ -86,7 +86,7 @@ static int LASIpAddPatternIPv6(NSErr_t *errp, int netmask, PRIPv6Addr *ipv6, LAS
  *    result        NULL on success or else one of the LAS_EVAL_* codes.
  */
 int
-dotdecimal(char *ipstr, char *netmaskstr, int *ip, int *netmask)
+dotdecimal(char *ipstr, const char *netmaskstr, int *ip, int *netmask)
 {
     int     i;
     char    token[64];
@@ -114,7 +114,7 @@ dotdecimal(char *ipstr, char *netmaskstr, int *ip, int *netmask)
     *netmask = *ip = 0;    /* Start with "don't care"    */
 
     for (i=0; i<4; i++) {
-        dotptr    = strchr(netmaskstr, '.');
+        dotptr    = strchr((char*)netmaskstr, '.');
 
         /* copy out the token, then point beyond it */
         if (dotptr == NULL)
@@ -725,7 +725,7 @@ LASIpAddPatternIPv6(NSErr_t *errp, int netmask, PRIPv6Addr *ipv6, LASIpTree_t **
  *  This is very similar to dotdecimal(), but for ipv6 addresses
  */
 static int
-colonhex_ipv6(char *ipstr, char *netmaskstr, PRIPv6Addr *ipv6, int *netmask)
+colonhex_ipv6(char *ipstr, const char *netmaskstr, PRIPv6Addr *ipv6, int *netmask)
 {
     PRNetAddr addr;
     /*
diff --git a/lib/libaccess/nsautherr.cpp b/lib/libaccess/nsautherr.cpp
index 7cea84e..cccb194 100644
--- a/lib/libaccess/nsautherr.cpp
+++ b/lib/libaccess/nsautherr.cpp
@@ -55,12 +55,12 @@
 #include "libaccess/nsautherr.h"
 
 /* Error message formats XXX internationalize XXX */
-static char * nsaerrnomem = "insufficient dynamic memory";
-static char * nsaerrinval = "invalid argument";
-static char * nsaerropen = "error opening %s";
-static char * nsaerrmkdir = "error creating %s";
-static char * nsaerrname = "%s not found in database %s";
-static char * unknownerr = "error code %d";
+static const char * nsaerrnomem = "insufficient dynamic memory";
+static const char * nsaerrinval = "invalid argument";
+static const char * nsaerropen = "error opening %s";
+static const char * nsaerrmkdir = "error creating %s";
+static const char * nsaerrname = "%s not found in database %s";
+static const char * unknownerr = "error code %d";
 
 /*
  * Description (nsadbErrorFmt)
diff --git a/lib/libaccess/oneeval.cpp b/lib/libaccess/oneeval.cpp
index 8e31940..8077969 100644
--- a/lib/libaccess/oneeval.cpp
+++ b/lib/libaccess/oneeval.cpp
@@ -609,8 +609,8 @@ static int
 ACL_INTEvalTestRights(
     NSErr_t          *errp,
     ACLEvalHandle_t  *acleval,
-    char    **rights,
-    char    **map_generic,
+    const char    **rights,
+    const char    **map_generic,
     char    **deny_type,
     char    **deny_response,
     char    **acl_tag,
@@ -638,7 +638,7 @@ ACL_INTEvalTestRights(
     int absolute = 0;
     int skipflag;
     int g_num;    /* index into the generic rights array.  */
-    char **g_rights;
+    const char **g_rights;
     PList_t global_auth=NULL;
     int allow_error = 0;
     int allow_absolute = 0;
@@ -953,7 +953,7 @@ ACL_CachableAclList(ACLListHandle_t *acllist)
     char *acl_tag;
     int  expr_num;
     int  rv;
-    static char *rights[] = { "http_get", NULL };
+    static const char *rights[] = { "http_get", NULL };
     ACLCachable_t cachable=ACL_INDEF_CACHABLE;
 
     if (!acllist  ||  acllist == ACL_LIST_NO_ACLS) {
@@ -978,8 +978,8 @@ NSAPI_PUBLIC int
 ACL_EvalTestRights(
     NSErr_t          *errp,
     ACLEvalHandle_t  *acleval,
-    char    **rights,
-    char    **map_generic,
+    const char    **rights,
+    const char    **map_generic,
     char    **deny_type,
     char    **deny_response,
     char    **acl_tag,
diff --git a/lib/libaccess/symbols.cpp b/lib/libaccess/symbols.cpp
index 209c05b..a1cba9d 100644
--- a/lib/libaccess/symbols.cpp
+++ b/lib/libaccess/symbols.cpp
@@ -121,7 +121,7 @@ static int symCmpValue(const void * value1, const void * value2)
 static PLHashNumber symHash(const void * symkey)
 {
     Symbol_t * sym = (Symbol_t *)symkey;
-    char * cp;
+    const char * cp;
     PLHashNumber h;
 
     h = sym->sym_type;
@@ -289,7 +289,7 @@ void symTableEnumerate(void * table, void * argp,
  *	negative return code (SYMERRxxxx - see symbols.h).
  */
 
-int symTableFindSym(void * table, char * symname,
+int symTableFindSym(void * table, const char * symname,
 		      int symtype, void **psymref)
 {
     SymTable_t * st = (SymTable_t *)table;
diff --git a/lib/libadmin/error.c b/lib/libadmin/error.c
index 4ba9803..a277cd8 100644
--- a/lib/libadmin/error.c
+++ b/lib/libadmin/error.c
@@ -127,7 +127,7 @@ NSAPI_PUBLIC void output_alert(int type, char *info, char *details, int wait)
     if(type==FILE_ERROR || type==SYSTEM_ERROR)  {
         err = get_error();
         if(err != 0){
-            char *err_str = verbose_error();
+            const char *err_str = verbose_error();
             fprintf(stdout,
                         "\\n\\nThe system returned error number %d, "
                         "which is %s.", err, err_str);
diff --git a/lib/libsi18n/getstrprop.c b/lib/libsi18n/getstrprop.c
index c63d6ba..22cbafb 100644
--- a/lib/libsi18n/getstrprop.c
+++ b/lib/libsi18n/getstrprop.c
@@ -50,7 +50,7 @@
 #include "getstrmem.h"
 
 static char*
-XP_GetStringFromMemory(char* strLibraryName,int iToken)
+XP_GetStringFromMemory(const char* strLibraryName,int iToken)
 {
   /*
    * In memory model called by XP_GetStringFromDatabase
@@ -66,7 +66,7 @@ XP_GetStringFromMemory(char* strLibraryName,int iToken)
   unsigned hashKey;
   int      found = 0;
   unsigned uToken = iToken;
-  char*    cPtr;
+  const char*    cPtr;
   DATABIN* pBucket;
 
   /* calculate hash key */
@@ -102,12 +102,12 @@ XP_GetStringFromMemory(char* strLibraryName,int iToken)
 
 }
 
-char*
-XP_GetStringFromDatabase(char* strLibraryName,
-                         char* strLanguage,
+const char*
+XP_GetStringFromDatabase(const char* strLibraryName,
+                         const char* strLanguage,
                          int key)
 {
-    char *result = NULL;
+    const char *result = NULL;
 
     /* we use memory strings only in ds. */
     if (result == NULL)
-- 
1.7.1

