summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wb_common.c7
-rw-r--r--source3/nsswitch/winbindd_nss.h2
-rw-r--r--source3/nsswitch/winbindd_rpc.c2
-rw-r--r--source3/nsswitch/winbindd_util.c2
4 files changed, 8 insertions, 5 deletions
diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c
index 9caf7affc3..6ba0cbbf42 100644
--- a/source3/nsswitch/wb_common.c
+++ b/source3/nsswitch/wb_common.c
@@ -26,6 +26,9 @@
#include "winbind_client.h"
+#define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr)))
+#define CONST_ADD(type, ptr) ((type) ((const void *) (ptr)))
+
/* Global variables. These are effectively the client state information */
int winbindd_fd = -1; /* fd for winbindd socket */
@@ -606,14 +609,14 @@ NSS_STATUS winbindd_request(int req_type,
BOOL winbind_off( void )
{
- static char *s = WINBINDD_DONT_ENV "=1";
+ static char *s = CONST_DISCARD(char *, WINBINDD_DONT_ENV "=1");
return putenv(s) != -1;
}
BOOL winbind_on( void )
{
- static char *s = WINBINDD_DONT_ENV "=0";
+ static char *s = CONST_DISCARD(char *, WINBINDD_DONT_ENV "=0");
return putenv(s) != -1;
}
diff --git a/source3/nsswitch/winbindd_nss.h b/source3/nsswitch/winbindd_nss.h
index 838ba1e211..06ebd68f8f 100644
--- a/source3/nsswitch/winbindd_nss.h
+++ b/source3/nsswitch/winbindd_nss.h
@@ -11,7 +11,7 @@
*/
#ifndef SAFE_FREE
-#define SAFE_FREE(x) do { if(x) {free((void *) (x)); x=NULL;} } while(0)
+#define SAFE_FREE(x) do { if(x) {free(CONST_DISCARD(void *, (x))); x=NULL;} } while(0)
#endif
#ifndef _WINBINDD_NTDOM_H
diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c
index 5e974736e3..1dfa810a8d 100644
--- a/source3/nsswitch/winbindd_rpc.c
+++ b/source3/nsswitch/winbindd_rpc.c
@@ -789,7 +789,7 @@ static int get_ldap_seq(const char *server, int port, uint32 *seq)
to.tv_usec = 0;
if (ldap_search_st(ldp, "", LDAP_SCOPE_BASE, "(objectclass=*)",
- (char **) &attrs[0], 0, &to, &res))
+ CONST_DISCARD(char **, &attrs[0]), 0, &to, &res))
goto done;
if (ldap_count_entries(ldp, res) != 1)
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index 3d03d6f4cc..9ae24e401f 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -636,7 +636,7 @@ BOOL parse_domain_user(const char *domuser, fstring domain, fstring user)
*/
void fill_domain_username(fstring name, const char *domain, const char *user)
{
- strlower_m( (char *) user );
+ strlower_m(CONST_DISCARD(char *, user));
if (assume_domain(domain)) {
strlcpy(name, user, sizeof(fstring));