summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-26 20:16:26 +0100
committerJeremy Allison <jra@samba.org>2014-11-25 07:25:45 +0100
commita5f35ed5cfe50be9cfd9d10812fd7534e1a12840 (patch)
tree3d63c78a8e4ee7c15747e0df1350a213c8134228
parent5d070d9f1844ebb120cf254c57f45c3aba9618ef (diff)
downloadsamba-a5f35ed5cfe50be9cfd9d10812fd7534e1a12840.tar.gz
s3:winbindd: avoid invalid pointer type warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/winbindd/idmap_nss.c4
-rw-r--r--source3/winbindd/winbindd_msrpc.c5
-rw-r--r--source3/winbindd/winbindd_rpc.c5
3 files changed, 11 insertions, 3 deletions
diff --git a/source3/winbindd/idmap_nss.c b/source3/winbindd/idmap_nss.c
index 5cd2bc24c36..e65a499974e 100644
--- a/source3/winbindd/idmap_nss.c
+++ b/source3/winbindd/idmap_nss.c
@@ -135,6 +135,7 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
for (i = 0; ids[i]; i++) {
struct group *gr;
enum lsa_SidType type;
+ const char *p = NULL;
char *name = NULL;
bool ret;
@@ -142,8 +143,9 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
the following call will not recurse so this is safe */
(void)winbind_on();
ret = winbind_lookup_sid(talloc_tos(), ids[i]->sid, NULL,
- (const char **)&name, &type);
+ &p, &type);
(void)winbind_off();
+ name = discard_const_p(char, p);
if (!ret) {
/* TODO: how do we know if the name is really not mapped,
diff --git a/source3/winbindd/winbindd_msrpc.c b/source3/winbindd/winbindd_msrpc.c
index 8454f93c03f..77e5ffc575d 100644
--- a/source3/winbindd/winbindd_msrpc.c
+++ b/source3/winbindd/winbindd_msrpc.c
@@ -234,6 +234,7 @@ static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
struct dom_sid *sids = NULL;
enum lsa_SidType *types = NULL;
char *full_name = NULL;
+ const char *names[1];
NTSTATUS name_map_status = NT_STATUS_UNSUCCESSFUL;
char *mapped_name = NULL;
@@ -265,8 +266,10 @@ static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
DEBUG(3,("name_to_sid [rpc] %s for domain %s\n",
full_name?full_name:"", domain_name ));
+ names[0] = full_name;
+
result = winbindd_lookup_names(mem_ctx, domain, 1,
- (const char **)&full_name, NULL,
+ names, NULL,
&sids, &types);
if (!NT_STATUS_IS_OK(result))
return result;
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index 7a80237e692..03bc9b577fc 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -277,6 +277,7 @@ NTSTATUS rpc_name_to_sid(TALLOC_CTX *mem_ctx,
enum lsa_SidType *types = NULL;
struct dom_sid *sids = NULL;
char *full_name = NULL;
+ const char *names[1];
char *mapped_name = NULL;
NTSTATUS status;
@@ -302,6 +303,8 @@ NTSTATUS rpc_name_to_sid(TALLOC_CTX *mem_ctx,
DEBUG(3,("name_to_sid: %s for domain %s\n",
full_name ? full_name : "", domain_name ));
+ names[0] = full_name;
+
/*
* We don't run into deadlocks here, cause winbind_off() is
* called in the main function.
@@ -310,7 +313,7 @@ NTSTATUS rpc_name_to_sid(TALLOC_CTX *mem_ctx,
mem_ctx,
lsa_policy,
1, /* num_names */
- (const char **) &full_name,
+ names,
NULL, /* domains */
1, /* level */
&sids,