diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-12-16 12:07:24 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-12-17 16:49:14 +0100 |
commit | 1dc2fa7616207a2d3a9f1cbe69b2ec1fc61634fd (patch) | |
tree | 9d8c72fe828ee8b59fee1a759ec6d6574f810cec | |
parent | 5e83a05009787d8a2086db1adc1ed58d61b3725d (diff) | |
download | samba-1dc2fa7616207a2d3a9f1cbe69b2ec1fc61634fd.tar.gz samba-1dc2fa7616207a2d3a9f1cbe69b2ec1fc61634fd.tar.bz2 samba-1dc2fa7616207a2d3a9f1cbe69b2ec1fc61634fd.zip |
s3:net ads dns register: use "cluster addresses" option if configured (bug #7871)
metze
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 17 16:49:14 CET 2010 on sn-devel-104
-rw-r--r-- | source3/utils/net_ads.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index f5aeb49198..daf26020fe 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -1493,6 +1493,7 @@ static int net_ads_dns_register(struct net_context *c, int argc, const char **ar NTSTATUS ntstatus; TALLOC_CTX *ctx; const char *hostname = NULL; + const char **addrs_list = NULL; struct sockaddr_storage *addrs = NULL; int num_addrs = 0; int count; @@ -1501,7 +1502,7 @@ static int net_ads_dns_register(struct net_context *c, int argc, const char **ar talloc_enable_leak_report(); #endif - if (argc <= 1 && lp_clustering()) { + if (argc <= 1 && lp_clustering() && lp_cluster_addresses() == NULL) { d_fprintf(stderr, _("Refusing DNS updates with automatic " "detection of addresses in a clustered " "setup.\n")); @@ -1528,6 +1529,13 @@ static int net_ads_dns_register(struct net_context *c, int argc, const char **ar if (argc > 1) { num_addrs = argc - 1; + addrs_list = &argv[1]; + } else if (lp_clustering()) { + addrs_list = lp_cluster_addresses(); + num_addrs = str_list_length(addrs_list); + } + + if (num_addrs > 0) { addrs = talloc_zero_array(ctx, struct sockaddr_storage, num_addrs); if (addrs == NULL) { d_fprintf(stderr, _("Error allocating memory!\n")); @@ -1537,10 +1545,10 @@ static int net_ads_dns_register(struct net_context *c, int argc, const char **ar } for (count = 0; count < num_addrs; count++) { - if (!interpret_string_addr(&addrs[count], argv[count+1], 0)) { + if (!interpret_string_addr(&addrs[count], addrs_list[count], 0)) { d_fprintf(stderr, "%s '%s'.\n", _("Cannot interpret address"), - argv[count+1]); + addrs_list[count]); talloc_free(ctx); return -1; } |