diff options
author | Pavel Reichl <preichl@redhat.com> | 2015-07-23 10:51:50 -0400 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-10-05 20:59:44 +0200 |
commit | 12a1c64105ff56b39e197264fec2d9aba6b84185 (patch) | |
tree | 6b8595264274ac7889a1d1c65aa19355c00e5a46 /src/providers/dp_dyndns.c | |
parent | 83ac838339d15192642e07710156a7c537f18248 (diff) | |
download | sssd-12a1c64105ff56b39e197264fec2d9aba6b84185.tar.gz sssd-12a1c64105ff56b39e197264fec2d9aba6b84185.tar.xz sssd-12a1c64105ff56b39e197264fec2d9aba6b84185.zip |
DYNDNS: use realm and server commands only as fallback
Resolves:
https://fedorahosted.org/sssd/ticket/2495
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/providers/dp_dyndns.c')
-rw-r--r-- | src/providers/dp_dyndns.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/providers/dp_dyndns.c b/src/providers/dp_dyndns.c index a5eb383bd..782dcb60a 100644 --- a/src/providers/dp_dyndns.c +++ b/src/providers/dp_dyndns.c @@ -376,6 +376,17 @@ static char *nsupdate_msg_add_ptr(char *update_msg, } static char * +nsupdate_msg_add_realm_cmd(TALLOC_CTX *mem_ctx, const char *realm) +{ +#ifdef HAVE_NSUPDATE_REALM + if (realm != NULL) { + return talloc_asprintf(mem_ctx, "realm %s\n", realm); + } +#endif + return talloc_asprintf(mem_ctx, "\n"); +} + +static char * nsupdate_msg_create_common(TALLOC_CTX *mem_ctx, const char *realm, const char *servername) { @@ -386,11 +397,7 @@ nsupdate_msg_create_common(TALLOC_CTX *mem_ctx, const char *realm, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) return NULL; -#ifdef HAVE_NSUPDATE_REALM - realm_directive = talloc_asprintf(tmp_ctx, "realm %s\n", realm); -#else - realm_directive = talloc_asprintf(tmp_ctx, "\n"); -#endif + realm_directive = nsupdate_msg_add_realm_cmd(tmp_ctx, realm); if (!realm_directive) { goto fail; } |