summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-11-20 21:33:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:32 -0500
commit78a328bef894a78881dfae9f278dd839b86fc82f (patch)
tree2acbf2a309707385787bfd7251d3419957bb5c46 /source4
parenta6852523d677f6c39a92e0e2b5d970211b29558b (diff)
downloadsamba-78a328bef894a78881dfae9f278dd839b86fc82f.tar.gz
samba-78a328bef894a78881dfae9f278dd839b86fc82f.tar.bz2
samba-78a328bef894a78881dfae9f278dd839b86fc82f.zip
r11813: Const-ify name resolution method list and use string list
utilities to set the context field. rafal (This used to be commit 5da8b457c34236b21f6e88e3a7a12338d0390a4f)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet.c11
-rw-r--r--source4/libnet/libnet.h2
2 files changed, 2 insertions, 11 deletions
diff --git a/source4/libnet/libnet.c b/source4/libnet/libnet.c
index b7b18b7417..ba995854b2 100644
--- a/source4/libnet/libnet.c
+++ b/source4/libnet/libnet.c
@@ -26,7 +26,6 @@ struct libnet_context *libnet_context_init(struct event_context *ev)
{
/* default name resolution methods */
const char *nr_methods[] = { "lmhosts", "wins", "host", "bcast", NULL };
- int nr_count = 0, nr_i;
struct libnet_context *ctx;
@@ -46,15 +45,7 @@ struct libnet_context *libnet_context_init(struct event_context *ev)
}
ctx->event_ctx = ev;
- /* count name resolution methods */
- while (nr_methods[nr_count]) nr_count++;
-
- /* assign name resolution methods */
- ctx->name_res_methods = talloc_array(ctx, char*, nr_count+1);
- for (nr_i = 0; nr_i < nr_count; nr_i++) {
- ctx->name_res_methods[nr_i] = talloc_strdup(ctx, nr_methods[nr_i]);
- }
- ctx->name_res_methods[nr_i] = NULL;
+ ctx->name_res_methods = str_list_copy(ctx, nr_methods);
return ctx;
}
diff --git a/source4/libnet/libnet.h b/source4/libnet/libnet.h
index 18dc376628..be22439590 100644
--- a/source4/libnet/libnet.h
+++ b/source4/libnet/libnet.h
@@ -33,7 +33,7 @@ struct libnet_context {
struct policy_handle user_handle;
/* name resolution methods */
- char **name_res_methods;
+ const char **name_res_methods;
struct event_context *event_ctx;
};