On Wed, Sep 12, 2012 at 12:33:47PM +0200, Petr Spacek wrote:
> Hello,
> 
> The patch fixes crash caused by stupid bug in logging code.

Ack.

> From 01aa00f9ba4feac9f97b34b81c3697b2b7f8122f Mon Sep 17 00:00:00 2001
> From: Petr Spacek <pspa...@redhat.com>
> Date: Fri, 7 Sep 2012 16:21:27 +0200
> Subject: [PATCH] Fix crash caused by zone deletion vs. SOA serial increment
>  race condition.
> 
> Signed-off-by: Petr Spacek <pspa...@redhat.com>
> ---
>  src/ldap_helper.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/ldap_helper.c b/src/ldap_helper.c
> index 
> e636a84b35d0bcdc8573c6e7146f38ee21a42076..058048f41485999be0d8ffeadea02f2e25879370
>  100644
> --- a/src/ldap_helper.c
> +++ b/src/ldap_helper.c
> @@ -2931,6 +2931,7 @@ soa_serial_increment(isc_mem_t *mctx, ldap_instance_t 
> *inst,
>               dns_name_t *zone_name) {
>       isc_result_t result = ISC_R_FAILURE;
>       ld_string_t *zone_dn = NULL;
> +     const char *zone_dn_char = "INACTIVE/UNKNOWN";
>       ldapdb_rdatalist_t rdatalist;
>       dns_rdatalist_t *rdlist = NULL;
>       dns_rdata_t *soa_rdata = NULL;
> @@ -2944,6 +2945,7 @@ soa_serial_increment(isc_mem_t *mctx, ldap_instance_t 
> *inst,
>       INIT_LIST(rdatalist);
>       CHECK(str_new(mctx, &zone_dn));
>       CHECK(dnsname_to_dn(inst->zone_register, zone_name, zone_dn));
> +     zone_dn_char = str_buf(zone_dn);
>       log_debug(5, "incrementing SOA serial number in zone '%s'",
>                               str_buf(zone_dn));
>  
> @@ -2978,7 +2980,7 @@ cleanup:
>       if (result != ISC_R_SUCCESS ||
>           isc_serial_gt(new_serial, old_serial) != ISC_TRUE)
>               log_error("SOA serial number incrementation failed in zone 
> '%s'",
> -                                     str_buf(zone_dn));
> +                             zone_dn_char);
>  
>       str_destroy(&zone_dn);
>       ldapdb_rdatalist_destroy(mctx, &rdatalist);
> -- 
> 1.7.11.4
> 


-- 
Adam Tkac, Red Hat, Inc.

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to