diff options
author | Pavel Reichl <preichl@redhat.com> | 2015-06-02 17:39:26 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-06-04 13:53:00 +0200 |
commit | 366c3020ca995563d2be1bb871a1164cca2f5427 (patch) | |
tree | 59d017049857aa3636658b57842e3b1c6adb972a | |
parent | 4f97aaa2fd81e90c2d1f74d8b6619083db4061a5 (diff) | |
download | sssd-366c3020ca995563d2be1bb871a1164cca2f5427.tar.gz sssd-366c3020ca995563d2be1bb871a1164cca2f5427.tar.xz sssd-366c3020ca995563d2be1bb871a1164cca2f5427.zip |
dyndns: don't pass zone directive to nsupdate
Don't pass zone directive to nsupdate for the first pass. The
information about zone should be generated by nsupdate which has
auto-detection logic for zone value. The previous version code sometime
worked but it broke when client domain was not the same as FreeIPA
domain.
Log without patch applied:
[ipa_dyndns_update_send] (0x0400): Performing update
[ipa_dyndns_sdap_update_done] (0x0040): Dynamic DNS update failed [5]: Input/output error
[ipa_dyndns_nsupdate_done] (0x0040): Updating DNS entry failed [5]: Input/output error
Log after patch applied:
[ipa_dyndns_update_send] (0x0400): Performing update
[ipa_dyndns_nsupdate_done] (0x0040): DNS update finished
Resolves:
https://fedorahosted.org/sssd/ticket/2540
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r-- | src/providers/ldap/sdap_dyndns.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_dyndns.c b/src/providers/ldap/sdap_dyndns.c index eb1969e95..0d9c92057 100644 --- a/src/providers/ldap/sdap_dyndns.c +++ b/src/providers/ldap/sdap_dyndns.c @@ -61,6 +61,7 @@ struct sdap_dyndns_update_state { enum be_nsupdate_auth auth_type; bool use_server_with_nsupdate; char *update_msg; + size_t pass_num; }; static void sdap_dyndns_update_addrs_done(struct tevent_req *subreq); @@ -108,6 +109,7 @@ sdap_dyndns_update_send(TALLOC_CTX *mem_ctx, state->ev = ev; state->opts = opts; state->auth_type = auth_type; + state->pass_num = 0; if (ifname) { /* Unless one family is restricted, just replace all @@ -308,6 +310,7 @@ sdap_dyndns_update_step(struct tevent_req *req) struct sdap_dyndns_update_state *state; const char *servername; struct tevent_req *subreq; + const char *dns_zone = NULL; state = tevent_req_data(req, struct sdap_dyndns_update_state); @@ -317,7 +320,11 @@ sdap_dyndns_update_step(struct tevent_req *req) servername = state->servername; } - ret = be_nsupdate_create_fwd_msg(state, state->realm, state->dns_zone, + if (state->pass_num > 0) { + dns_zone = state->dns_zone; + } + + ret = be_nsupdate_create_fwd_msg(state, state->realm, dns_zone, servername, state->hostname, state->ttl, state->remove_af, state->addresses, @@ -326,6 +333,7 @@ sdap_dyndns_update_step(struct tevent_req *req) DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses for DNS update\n"); return ret; } + state->pass_num++; /* Fork a child process to perform the DNS update */ subreq = be_nsupdate_send(state, state->ev, state->auth_type, |