summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 5cd2bc24c3..e65a499974 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 8454f93c03..77e5ffc575 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 7a80237e69..03bc9b577f 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,