From pspacek@redhat.com Fri Aug 19 14:23:13 2016 X-Scanned-BY: MIMEDefang 2.68 on 10.5.11.23 CC: "Evan Hunt" MIME-Version: 1.0 In-Reply-To: X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-RT-Interface: API References: <788ba4fd-9fd2-abf0-8512-3539bc9320ab@redhat.com> Message-ID: <1c3fddb0-405f-42dc-95dc-d8c93ca31270@redhat.com> content-type: text/plain; charset="utf-8" Organization: Red Hat X-RT-Original-Encoding: utf-8 Received: from mx.pao1.isc.org (mx.pao1.isc.org [IPv6:2001:4f8:0:2::2b]) by bugs.isc.org (Postfix) with ESMTP id 8239C71B5A8 for ; Fri, 19 Aug 2016 14:23:12 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.pao1.isc.org (Postfix) with ESMTPS id BD0AE3493ED; Fri, 19 Aug 2016 14:23:09 +0000 (UTC) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7BADC04B302; Fri, 19 Aug 2016 14:23:08 +0000 (UTC) Received: from pspacek.brq.redhat.com (pspacek.brq.redhat.com [10.34.128.7]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7JEN6rd001396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Aug 2016 10:23:08 -0400 Delivered-To: bind9-review@bugs.isc.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 Subject: Re: [ISC-Bugs #43050] pre-release DynDB nits Return-Path: X-Original-To: bind9-review@bugs.isc.org Date: Fri, 19 Aug 2016 16:23:06 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 19 Aug 2016 14:23:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.pao1.isc.org To: bind9-review@isc.org Content-Transfer-Encoding: 7bit From: "Petr Spacek" RT-Message-ID: Content-Length: 1971 On 18.8.2016 14:28, Mark Andrews via RT wrote: > On Thu Aug 18 01:23:49 2016, pspacek@redhat.com wrote: >> On 17.8.2016 20:41, Evan Hunt via RT wrote: >> I fetched 3390d74e33385337631b19e68760025e0ca5d6ec from Git and >> confirm that >> it fixes the problem in parser. >> >> The new header isc/errno.h works fine if I install it manually. It >> does not >> get installed using 'make install' - I think that this deserves one >> more patch. > > addressed I confirm it works for me. Now the plugin should be build-able with BIND 9.11rc1. Now I started to play with parser a little bit more and I wonder if there is a way to pass file + line information from "parent" config object to the plugin so the error reporting could give meaningful results. bin/named/server.c:configure_dyndb() is now calling cfg_obj_asstring() before the data are given to the plugin so all auxiliary information from cfg_obj_t are lost. Would it help to pass plain cfg_obj_t instead of string to plugins? (The plugin can call cfg_obj_asstring() if desired.) I'm not sure... Is there a way to take cfg_type_bracketed_text and feed it into parser again while supplying own cfg_type_t? I mean, is it possible to call the parser and tell it to re-interpret cfg_type_bracketed_text as some other cfg_type_t? That would improve user experience and general debugging as well because plugins would be able to print nice error messages using cfg_obj_log() etc. Wondering a bit more about this, there is an alternative: Plugin API could contain new symbol (provided by the plugin) which would contain cfg_type_t for plugin's top-level config. This symbol could be used instead of cfg_type_bracketed_text by the named's parser and resulting cfg_obj could be just passed to the plugin (e.g. attached to dctx). As a side-effect it would enable users to use "include" in plugin config (I guess). What do you think? What are viable alternatives? Have a nice weekend! -- Petr Spacek @ Red Hat