summaryrefslogtreecommitdiffstats
path: root/source/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'source/nsswitch')
-rw-r--r--source/nsswitch/wb_common.c7
-rw-r--r--source/nsswitch/winbindd_nss.h2
-rw-r--r--source/nsswitch/winbindd_rpc.c2
-rw-r--r--source/nsswitch/winbindd_util.c2
4 files changed, 8 insertions, 5 deletions
diff --git a/source/nsswitch/wb_common.c b/source/nsswitch/wb_common.c
index 9caf7affc39..6ba0cbbf428 100644
--- a/source/nsswitch/wb_common.c
+++ b/source/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/source/nsswitch/winbindd_nss.h b/source/nsswitch/winbindd_nss.h
index 838ba1e211e..06ebd68f8f8 100644
--- a/source/nsswitch/winbindd_nss.h
+++ b/source/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/source/nsswitch/winbindd_rpc.c b/source/nsswitch/winbindd_rpc.c
index 5e974736e3d..1dfa810a8d3 100644
--- a/source/nsswitch/winbindd_rpc.c
+++ b/source/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/source/nsswitch/winbindd_util.c b/source/nsswitch/winbindd_util.c
index 3d03d6f4cc4..9ae24e401fd 100644
--- a/source/nsswitch/winbindd_util.c
+++ b/source/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));