summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/tests/strlist.c6
-rw-r--r--lib/util/util.h9
-rw-r--r--lib/util/util_strlist.c18
-rw-r--r--libcli/nbt/namerefresh.c4
-rw-r--r--libcli/nbt/nameregister.c4
-rw-r--r--source3/Makefile.in4
-rw-r--r--source3/auth/auth.c4
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/lib/util_str.c107
-rw-r--r--source3/libads/ldap.c4
-rw-r--r--source3/rpc_server/srv_svcctl_nt.c2
-rw-r--r--source3/smbd/password.c4
-rw-r--r--source4/auth/sam.c2
-rw-r--r--source4/client/client.c2
-rw-r--r--source4/dsdb/common/util.c2
-rw-r--r--source4/libcli/resolve/wins.c2
-rw-r--r--source4/libnet/libnet_lookup.c2
-rw-r--r--source4/nbt_server/wins/winsclient.c2
-rw-r--r--source4/param/generic.c2
-rw-r--r--source4/param/loadparm.c6
-rw-r--r--source4/rpc_server/remote/dcesrv_remote.c2
-rw-r--r--source4/torture/nbt/wins.c8
-rw-r--r--source4/winbind/wb_samba3_cmd.c2
23 files changed, 48 insertions, 154 deletions
diff --git a/lib/util/tests/strlist.c b/lib/util/tests/strlist.c
index 9af26f9e71..8605102954 100644
--- a/lib/util/tests/strlist.c
+++ b/lib/util/tests/strlist.c
@@ -71,17 +71,17 @@ static bool test_list_copy(struct torture_context *tctx)
const char *empty_list[] = { NULL };
const char **null_list = NULL;
- result = str_list_copy(tctx, list);
+ result = (const char **)str_list_copy(tctx, list);
torture_assert_int_equal(tctx, str_list_length(result), 2, "list length");
torture_assert_str_equal(tctx, result[0], "foo", "element 0");
torture_assert_str_equal(tctx, result[1], "bar", "element 1");
torture_assert_str_equal(tctx, result[2], NULL, "element 2");
- result = str_list_copy(tctx, empty_list);
+ result = (const char **)str_list_copy(tctx, empty_list);
torture_assert_int_equal(tctx, str_list_length(result), 0, "list length");
torture_assert_str_equal(tctx, result[0], NULL, "element 0");
- result = str_list_copy(tctx, null_list);
+ result = (const char **)str_list_copy(tctx, null_list);
torture_assert(tctx, result == NULL, "result NULL");
return true;
diff --git a/lib/util/util.h b/lib/util/util.h
index 861b6affe5..5cecad7350 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -21,10 +21,9 @@
#ifndef _SAMBA_UTIL_H_
#define _SAMBA_UTIL_H_
+#include "lib/charset/charset.h"
#include "../lib/util/attr.h"
-#include "charset/charset.h"
-
/* for TALLOC_CTX */
#include <talloc.h>
@@ -452,7 +451,7 @@ _PUBLIC_ bool strequal(const char *s1, const char *s2);
separator list. The separator list must contain characters less than
or equal to 0x2f for this to work correctly on multi-byte strings
*/
-_PUBLIC_ const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
+_PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
/**
* build a null terminated list of strings from an argv-like input string
@@ -473,12 +472,12 @@ _PUBLIC_ char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char
/**
return the number of elements in a string list
*/
-_PUBLIC_ size_t str_list_length(const char **list);
+_PUBLIC_ size_t str_list_length(const char * const *list);
/**
copy a string list
*/
-_PUBLIC_ const char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
+_PUBLIC_ char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
/**
Return true if all the elements of the list match exactly.
diff --git a/lib/util/util_strlist.c b/lib/util/util_strlist.c
index 30de4b962d..f576024cd1 100644
--- a/lib/util/util_strlist.c
+++ b/lib/util/util_strlist.c
@@ -21,6 +21,8 @@
#include "includes.h"
#include "system/locale.h"
+#undef strcasecmp
+
/**
* @file
* @brief String list manipulation
@@ -31,30 +33,30 @@
separator list. The separator list must contain characters less than
or equal to 0x2f for this to work correctly on multi-byte strings
*/
-_PUBLIC_ const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
+_PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
{
int num_elements = 0;
- const char **ret = NULL;
+ char **ret = NULL;
if (sep == NULL) {
sep = LIST_SEP;
}
- ret = talloc_array(mem_ctx, const char *, 1);
+ ret = talloc_array(mem_ctx, char *, 1);
if (ret == NULL) {
return NULL;
}
while (string && *string) {
size_t len = strcspn(string, sep);
- const char **ret2;
+ char **ret2;
if (len == 0) {
string += strspn(string, sep);
continue;
}
- ret2 = talloc_realloc(mem_ctx, ret, const char *, num_elements+2);
+ ret2 = talloc_realloc(mem_ctx, ret, char *, num_elements+2);
if (ret2 == NULL) {
talloc_free(ret);
return NULL;
@@ -196,15 +198,15 @@ _PUBLIC_ size_t str_list_length(const char **list)
/**
copy a string list
*/
-_PUBLIC_ const char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list)
+_PUBLIC_ char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list)
{
int i;
- const char **ret;
+ char **ret;
if (list == NULL)
return NULL;
- ret = talloc_array(mem_ctx, const char *, str_list_length(list)+1);
+ ret = talloc_array(mem_ctx, char *, str_list_length(list)+1);
if (ret == NULL)
return NULL;
diff --git a/libcli/nbt/namerefresh.c b/libcli/nbt/namerefresh.c
index 37bf0fc8f1..77f9cbd45c 100644
--- a/libcli/nbt/namerefresh.c
+++ b/libcli/nbt/namerefresh.c
@@ -234,11 +234,11 @@ _PUBLIC_ struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_so
if (state->io == NULL) goto failed;
state->wins_port = io->in.wins_port;
- state->wins_servers = str_list_copy(state, io->in.wins_servers);
+ state->wins_servers = (const char **)str_list_copy(state, io->in.wins_servers);
if (state->wins_servers == NULL ||
state->wins_servers[0] == NULL) goto failed;
- state->addresses = str_list_copy(state, io->in.addresses);
+ state->addresses = (const char **)str_list_copy(state, io->in.addresses);
if (state->addresses == NULL ||
state->addresses[0] == NULL) goto failed;
diff --git a/libcli/nbt/nameregister.c b/libcli/nbt/nameregister.c
index d4728a8e02..d9e616fecc 100644
--- a/libcli/nbt/nameregister.c
+++ b/libcli/nbt/nameregister.c
@@ -372,11 +372,11 @@ _PUBLIC_ struct composite_context *nbt_name_register_wins_send(struct nbt_name_s
if (state->io == NULL) goto failed;
state->wins_port = io->in.wins_port;
- state->wins_servers = str_list_copy(state, io->in.wins_servers);
+ state->wins_servers = (const char **)str_list_copy(state, io->in.wins_servers);
if (state->wins_servers == NULL ||
state->wins_servers[0] == NULL) goto failed;
- state->addresses = str_list_copy(state, io->in.addresses);
+ state->addresses = (const char **)str_list_copy(state, io->in.addresses);
if (state->addresses == NULL ||
state->addresses[0] == NULL) goto failed;
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 52dcbfb939..65a9ca42e4 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -323,8 +323,8 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) \
../lib/util/time.o \
lib/ufc.o lib/genrand.o lib/username.o \
lib/util_pw.o lib/access.o lib/smbrun.o \
- lib/bitmap.o ../lib/crypto/crc32.o lib/dprintf.o \
- ../lib/util/xfile.o lib/wins_srv.o $(UTIL_REG_OBJ) \
+ lib/bitmap.o ../lib/crypto/crc32.o lib/dprintf.o $(UTIL_REG_OBJ) \
+ ../lib/util/xfile.o ../lib/util/util_strlist.o lib/wins_srv.o \
lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
lib/util_unistr.o lib/util_file.o lib/data_blob.o \
lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index 754cb7a508..7f95656bef 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -459,8 +459,8 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
NTSTATUS nt_status;
if (lp_auth_methods()
- && !str_list_copy(talloc_tos(), &auth_method_list,
- lp_auth_methods())) {
+ && !(auth_method_list = str_list_copy(talloc_tos(),
+ lp_auth_methods()))) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/include/proto.h b/source3/include/proto.h
index d4b9e67caa..34db104905 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1672,9 +1672,9 @@ char *binary_string_rfc2254(char *buf, int len);
char *binary_string(char *buf, int len);
int fstr_sprintf(fstring s, const char *fmt, ...);
char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
-bool str_list_copy(TALLOC_CTX *mem_ctx, char ***dest, const char **src);
+char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
bool str_list_compare(char **list1, char **list2);
-int str_list_count( const char **list );
+size_t str_list_length( const char **list );
bool str_list_sub_basic( char **list, const char *smb_name,
const char *domain_name );
bool str_list_substitute(char **list, const char *pattern, const char *insert);
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 9f952abf10..b0a7cb072d 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1843,97 +1843,6 @@ int fstr_sprintf(fstring s, const char *fmt, ...)
#define S_LIST_ABS 16 /* List Allocation Block Size */
-char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
-{
- char **list;
- const char *str;
- char *s;
- int num, lsize;
- char *tok;
-
- if (!string || !*string)
- return NULL;
-
- list = TALLOC_ARRAY(mem_ctx, char *, S_LIST_ABS+1);
- if (list == NULL) {
- return NULL;
- }
- lsize = S_LIST_ABS;
-
- s = talloc_strdup(list, string);
- if (s == NULL) {
- DEBUG(0,("str_list_make: Unable to allocate memory"));
- TALLOC_FREE(list);
- return NULL;
- }
- if (!sep) sep = LIST_SEP;
-
- num = 0;
- str = s;
-
- while (next_token_talloc(list, &str, &tok, sep)) {
-
- if (num == lsize) {
- char **tmp;
-
- lsize += S_LIST_ABS;
-
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, list, char *,
- lsize + 1);
- if (tmp == NULL) {
- DEBUG(0,("str_list_make: "
- "Unable to allocate memory"));
- TALLOC_FREE(list);
- return NULL;
- }
-
- list = tmp;
-
- memset (&list[num], 0,
- ((sizeof(char**)) * (S_LIST_ABS +1)));
- }
-
- list[num] = tok;
- num += 1;
- }
-
- list[num] = NULL;
-
- TALLOC_FREE(s);
- return list;
-}
-
-bool str_list_copy(TALLOC_CTX *mem_ctx, char ***dest, const char **src)
-{
- char **list;
- int i, num;
-
- *dest = NULL;
- if (!src)
- return false;
-
- num = 0;
- while (src[num] != NULL) {
- num += 1;
- }
-
- list = TALLOC_ARRAY(mem_ctx, char *, num+1);
- if (list == NULL) {
- return false;
- }
-
- for (i=0; i<num; i++) {
- list[i] = talloc_strdup(list, src[i]);
- if (list[i] == NULL) {
- TALLOC_FREE(list);
- return false;
- }
- }
- list[i] = NULL;
- *dest = list;
- return true;
-}
-
/**
* Return true if all the elements of the list match exactly.
**/
@@ -1956,22 +1865,6 @@ bool str_list_compare(char **list1, char **list2)
return true;
}
-/******************************************************************************
- *****************************************************************************/
-
-int str_list_count( const char **list )
-{
- int i = 0;
-
- if ( ! list )
- return 0;
-
- /* count the number of list members */
-
- for ( i=0; *list; i++, list++ );
-
- return i;
-}
/******************************************************************************
version of standard_sub_basic() for string lists; uses talloc_sub_basic()
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 40f052281d..e78465f7da 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -832,7 +832,7 @@ static ADS_STATUS ads_do_paged_search_args(ADS_STRUCT *ads,
else {
/* This would be the utf8-encoded version...*/
/* if (!(search_attrs = ads_push_strvals(ctx, attrs))) */
- if (!(str_list_copy(talloc_tos(), &search_attrs, attrs))) {
+ if (!(search_attrs = str_list_copy(talloc_tos(), attrs))) {
rc = LDAP_NO_MEMORY;
goto done;
}
@@ -1144,7 +1144,7 @@ ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
else {
/* This would be the utf8-encoded version...*/
/* if (!(search_attrs = ads_push_strvals(ctx, attrs))) */
- if (!(str_list_copy(talloc_tos(), &search_attrs, attrs)))
+ if (!(search_attrs = str_list_copy(talloc_tos(), attrs)))
{
DEBUG(1,("ads_do_search: str_list_copy() failed!"));
rc = LDAP_NO_MEMORY;
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index a57d0ff4a4..1caf4941a4 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -61,7 +61,7 @@ static const struct generic_mapping svc_generic_map =
bool init_service_op_table( void )
{
const char **service_list = lp_svcctl_list();
- int num_services = SVCCTL_NUM_INTERNAL_SERVICES + str_list_count( service_list );
+ int num_services = SVCCTL_NUM_INTERNAL_SERVICES + str_list_length( service_list );
int i;
if ( !(svcctl_ops = TALLOC_ARRAY( NULL, struct service_control_op, num_services+1)) ) {
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 1d3514429f..88e7b766be 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -545,7 +545,7 @@ static bool user_ok(const char *user, int snum)
ret = True;
if (lp_invalid_users(snum)) {
- str_list_copy(talloc_tos(), &invalid, lp_invalid_users(snum));
+ invalid = str_list_copy(talloc_tos(), lp_invalid_users(snum));
if (invalid &&
str_list_substitute(invalid, "%S", lp_servicename(snum))) {
@@ -561,7 +561,7 @@ static bool user_ok(const char *user, int snum)
TALLOC_FREE(invalid);
if (ret && lp_valid_users(snum)) {
- str_list_copy(talloc_tos(), &valid, lp_valid_users(snum));
+ valid = str_list_copy(talloc_tos(), lp_valid_users(snum));
if ( valid &&
str_list_substitute(valid, "%S", lp_servicename(snum)) ) {
diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index 19ddc7cb74..d04a254d6c 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -207,7 +207,7 @@ _PUBLIC_ NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx,
if (logon_workstation && workstation_list && *workstation_list) {
bool invalid_ws = true;
int i;
- const char **workstations = str_list_make(mem_ctx, workstation_list, ",");
+ const char **workstations = (const char **)str_list_make(mem_ctx, workstation_list, ",");
for (i = 0; workstations && workstations[i]; i++) {
DEBUG(10,("sam_account_ok: checking for workstation match '%s' and '%s'\n",
diff --git a/source4/client/client.c b/source4/client/client.c
index 3523c4d274..3213c8931f 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -2754,7 +2754,7 @@ process a -c command string
****************************************************************************/
static int process_command_string(struct smbclient_context *ctx, const char *cmd)
{
- const char **lines;
+ char **lines;
int i, rc = 0;
lines = str_list_make(NULL, cmd, ";");
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 21e6781d79..5b93efb316 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1912,7 +1912,7 @@ struct ldb_dn *samdb_dns_domain_to_dn(struct ldb_context *ldb, TALLOC_CTX *mem_c
return NULL;
}
- split_realm = str_list_make(tmp_ctx, dns_domain, ".");
+ split_realm = (const char **)str_list_make(tmp_ctx, dns_domain, ".");
if (!split_realm) {
talloc_free(tmp_ctx);
return NULL;
diff --git a/source4/libcli/resolve/wins.c b/source4/libcli/resolve/wins.c
index ebce9b98bd..f787d52d31 100644
--- a/source4/libcli/resolve/wins.c
+++ b/source4/libcli/resolve/wins.c
@@ -79,7 +79,7 @@ NTSTATUS resolve_name_wins(struct nbt_name *name,
bool resolve_context_add_wins_method(struct resolve_context *ctx, const char **address_list, struct interface *ifaces, uint16_t nbt_port, int nbt_timeout)
{
struct resolve_wins_data *wins_data = talloc(ctx, struct resolve_wins_data);
- wins_data->address_list = str_list_copy(wins_data, address_list);
+ wins_data->address_list = (const char **)str_list_copy(wins_data, address_list);
wins_data->ifaces = talloc_reference(wins_data, ifaces);
wins_data->nbt_port = nbt_port;
wins_data->nbt_timeout = nbt_timeout;
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index cab4d9e73f..dc54ec3cf1 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -129,7 +129,7 @@ NTSTATUS libnet_Lookup_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
if (NT_STATUS_IS_OK(status)) {
s = talloc_get_type(c->private_data, struct lookup_state);
- io->out.address = str_list_make(mem_ctx, s->address, NULL);
+ io->out.address = (const char **)str_list_make(mem_ctx, s->address, NULL);
NT_STATUS_HAVE_NO_MEMORY(io->out.address);
}
diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c
index 1d07f4a60a..133592f1fd 100644
--- a/source4/nbt_server/wins/winsclient.c
+++ b/source4/nbt_server/wins/winsclient.c
@@ -140,7 +140,7 @@ static void nbtd_wins_refresh(struct event_context *ev, struct timed_event *te,
/* setup a wins name refresh request */
io.in.name = iname->name;
- io.in.wins_servers = str_list_make(tmp_ctx, iname->wins_server, NULL);
+ io.in.wins_servers = (const char **)str_list_make(tmp_ctx, iname->wins_server, NULL);
io.in.wins_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
io.in.addresses = nbtd_address_list(iface, tmp_ctx);
io.in.nb_flags = iname->nb_flags;
diff --git a/source4/param/generic.c b/source4/param/generic.c
index 80735d2a33..ed3045605d 100644
--- a/source4/param/generic.c
+++ b/source4/param/generic.c
@@ -130,7 +130,7 @@ const char **param_get_string_list(struct param_context *ctx, const char *param,
if (separator == NULL)
separator = LIST_SEP;
- return str_list_make(ctx, p->value, separator);
+ return (const char **)str_list_make(ctx, p->value, separator);
}
int param_set_string_list(struct param_context *ctx, const char *param, const char **list, const char *section)
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index dbc4776bd8..e626cdf5dd 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -885,7 +885,7 @@ const char **lp_parm_string_list(TALLOC_CTX *mem_ctx,
const char *value = lp_get_parametric(lp_ctx, service, type, option);
if (value != NULL)
- return str_list_make(mem_ctx, value, separator);
+ return (const char **)str_list_make(mem_ctx, value, separator);
return NULL;
}
@@ -1299,7 +1299,7 @@ static void copy_service(struct loadparm_service *pserviceDest,
strupper(*(char **)dest_ptr);
break;
case P_LIST:
- *(const char ***)dest_ptr = str_list_copy(pserviceDest,
+ *(const char ***)dest_ptr = (const char **)str_list_copy(pserviceDest,
*(const char ***)src_ptr);
break;
default:
@@ -1653,7 +1653,7 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr,
}
case P_LIST:
- *(const char ***)parm_ptr = str_list_make(mem_ctx,
+ *(const char ***)parm_ptr = (const char **)str_list_make(mem_ctx,
pszParmValue, NULL);
break;
diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c
index cd32160d88..3cf8fbe8fb 100644
--- a/source4/rpc_server/remote/dcesrv_remote.c
+++ b/source4/rpc_server/remote/dcesrv_remote.c
@@ -225,7 +225,7 @@ static NTSTATUS remote_register_one_iface(struct dcesrv_context *dce_ctx, const
static NTSTATUS remote_op_init_server(struct dcesrv_context *dce_ctx, const struct dcesrv_endpoint_server *ep_server)
{
int i;
- const char **ifaces = str_list_make(dce_ctx, lp_parm_string(dce_ctx->lp_ctx, NULL, "dcerpc_remote", "interfaces"),NULL);
+ const char **ifaces = (const char **)str_list_make(dce_ctx, lp_parm_string(dce_ctx->lp_ctx, NULL, "dcerpc_remote", "interfaces"),NULL);
if (!ifaces) {
DEBUG(3,("remote_op_init_server: no interfaces configured\n"));
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c
index ad9a97f133..0399daedf0 100644
--- a/source4/torture/nbt/wins.c
+++ b/source4/torture/nbt/wins.c
@@ -95,8 +95,8 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
torture_comment(tctx, "register the name\n");
io.in.name = *name;
io.in.wins_port = lp_nbt_port(tctx->lp_ctx);
- io.in.wins_servers = str_list_make(tctx, address, NULL);
- io.in.addresses = str_list_make(tctx, myaddress, NULL);
+ io.in.wins_servers = (const char **)str_list_make(tctx, address, NULL);
+ io.in.addresses = (const char **)str_list_make(tctx, myaddress, NULL);
io.in.nb_flags = nb_flags;
io.in.ttl = 300000;
@@ -168,8 +168,8 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
torture_comment(tctx, "refresh the name\n");
refresh.in.name = *name;
refresh.in.wins_port = lp_nbt_port(tctx->lp_ctx);
- refresh.in.wins_servers = str_list_make(tctx, address, NULL);
- refresh.in.addresses = str_list_make(tctx, myaddress, NULL);
+ refresh.in.wins_servers = (const char **)str_list_make(tctx, address, NULL);
+ refresh.in.addresses = (const char **)str_list_make(tctx, myaddress, NULL);
refresh.in.nb_flags = nb_flags;
refresh.in.ttl = 12345;
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c
index c2ba55ff18..03b59f56e9 100644
--- a/source4/winbind/wb_samba3_cmd.c
+++ b/source4/winbind/wb_samba3_cmd.c
@@ -113,7 +113,7 @@ NTSTATUS wbsrv_samba3_netbios_name(struct wbsrv_samba3_call *s3call)
NTSTATUS wbsrv_samba3_priv_pipe_dir(struct wbsrv_samba3_call *s3call)
{
- char *path = s3call->wbconn->listen_socket->service->priv_socket_path;
+ const char *path = s3call->wbconn->listen_socket->service->priv_socket_path;
s3call->response.result = WINBINDD_OK;
s3call->response.extra_data.data = path;