mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3-net: pass down struct net_context to the dns update calls.
Guenther
This commit is contained in:
parent
06f3b1f0b0
commit
a2fec69b09
@ -1131,7 +1131,8 @@ DNS_ERROR DoDNSUpdate(char *pszServerName,
|
||||
const struct sockaddr_storage *sslist,
|
||||
size_t num_addrs );
|
||||
|
||||
static NTSTATUS net_update_dns_internal(TALLOC_CTX *ctx, ADS_STRUCT *ads,
|
||||
static NTSTATUS net_update_dns_internal(struct net_context *c,
|
||||
TALLOC_CTX *ctx, ADS_STRUCT *ads,
|
||||
const char *machine_name,
|
||||
const struct sockaddr_storage *addrs,
|
||||
int num_addrs)
|
||||
@ -1242,7 +1243,8 @@ done:
|
||||
return status;
|
||||
}
|
||||
|
||||
static NTSTATUS net_update_dns_ext(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads,
|
||||
static NTSTATUS net_update_dns_ext(struct net_context *c,
|
||||
TALLOC_CTX *mem_ctx, ADS_STRUCT *ads,
|
||||
const char *hostname,
|
||||
struct sockaddr_storage *iplist,
|
||||
int num_addrs)
|
||||
@ -1274,18 +1276,18 @@ static NTSTATUS net_update_dns_ext(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads,
|
||||
iplist = iplist_alloc;
|
||||
}
|
||||
|
||||
status = net_update_dns_internal(mem_ctx, ads, machine_name,
|
||||
status = net_update_dns_internal(c, mem_ctx, ads, machine_name,
|
||||
iplist, num_addrs);
|
||||
|
||||
SAFE_FREE(iplist_alloc);
|
||||
return status;
|
||||
}
|
||||
|
||||
static NTSTATUS net_update_dns(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads, const char *hostname)
|
||||
static NTSTATUS net_update_dns(struct net_context *c, TALLOC_CTX *mem_ctx, ADS_STRUCT *ads, const char *hostname)
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = net_update_dns_ext(mem_ctx, ads, hostname, NULL, 0);
|
||||
status = net_update_dns_ext(c, mem_ctx, ads, hostname, NULL, 0);
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
@ -1315,7 +1317,7 @@ static int net_ads_join_usage(struct net_context *c, int argc, const char **argv
|
||||
}
|
||||
|
||||
|
||||
static void _net_ads_join_dns_updates(TALLOC_CTX *ctx, struct libnet_JoinCtx *r)
|
||||
static void _net_ads_join_dns_updates(struct net_context *c, TALLOC_CTX *ctx, struct libnet_JoinCtx *r)
|
||||
{
|
||||
#if defined(WITH_DNS_UPDATES)
|
||||
ADS_STRUCT *ads_dns = NULL;
|
||||
@ -1389,7 +1391,7 @@ static void _net_ads_join_dns_updates(TALLOC_CTX *ctx, struct libnet_JoinCtx *r)
|
||||
goto done;
|
||||
}
|
||||
|
||||
status = net_update_dns(ctx, ads_dns, NULL);
|
||||
status = net_update_dns(c, ctx, ads_dns, NULL);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_fprintf( stderr, _("DNS update failed: %s\n"),
|
||||
nt_errstr(status));
|
||||
@ -1545,7 +1547,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
|
||||
* If the dns update fails, we still consider the join
|
||||
* operation as succeeded if we came this far.
|
||||
*/
|
||||
_net_ads_join_dns_updates(ctx, r);
|
||||
_net_ads_join_dns_updates(c, ctx, r);
|
||||
|
||||
TALLOC_FREE(r);
|
||||
TALLOC_FREE( ctx );
|
||||
@ -1641,7 +1643,7 @@ static int net_ads_dns_register(struct net_context *c, int argc, const char **ar
|
||||
return -1;
|
||||
}
|
||||
|
||||
ntstatus = net_update_dns_ext(ctx, ads, hostname, addrs, num_addrs);
|
||||
ntstatus = net_update_dns_ext(c, ctx, ads, hostname, addrs, num_addrs);
|
||||
if (!NT_STATUS_IS_OK(ntstatus)) {
|
||||
d_fprintf( stderr, _("DNS update failed!\n") );
|
||||
ads_destroy( &ads );
|
||||
|
Loading…
Reference in New Issue
Block a user