Discussion:
[Opendnssec-user] OpenBSD porting questions regarding 2.x
Patrik Lundin
2016-09-04 08:43:13 UTC
Permalink
Hello,

I have recently started looking at upgrading the OpenBSD port of
OpenDNSSEC to 2.x, currently 2.0.1.

Some questions have turned up:

* When compared to 1.4.10 I notice that the ods-getconf tool is missing,
and this is not mentioned in
https://www.opendnssec.org/2016/07/opendnssec-2-0-0/. I have not used
that tool myself, but just wondering if the omission is by design or a
mistake.
* When fixing errors/warnings in the build, what git branch should these
be merged against? There seems to be at least develop, master,
2.0/develop and 2.0/master to chose from.
--
Patrik Lundin
Patrik Lundin
2016-09-04 11:26:18 UTC
Permalink
Hello again,

Another question that popped up when digging around: I am not entirely
certain of the role of /var/opendnssec/enforcer/zones.xml.

From what I can tell from the migration steps it is used by the signer
and is supposed to be initally created by copying the old
/etc/opendnssec/zonelist.xml there.

It is then stated that zonelist.xml is no longer updated automatically,
meaning the enforcer database is the authoritative source of information
rather than that file. As stated in the example zonelist.xml:
===
As a result in 2.0 the contents of the enforcer database should be considered
the 'master' for the list of currently configured zones, not the zonelist.xml
file as the file can easily become out of sync with the database.
===

Instead I notice that /var/opendnssec/enforcer/zones.xml will be created or
appended to when a zone is added with "ods-enforcer zone add --zone example.com".
Why has this file been introduced? Doesn't the "can easily become out of sync
with the database" hold true for this file as well?

From my perspective there are now two files: zones.xml which is (hopefully)
always in sync with the database, and zonelist.xml which _may_ be in sync with
the database based on operational procedures (running "ods-enforcer zonelist
export" from time to time or adding zones with --xml like "ods-enforcer zone
add --zone example.com --xml".

If the goal is to not have two places that may get out of sync, why not have
the signer fetch information directly from the database?

Finally, what is the appropriate thing to do with zones.xml on a fresh install?
I notice an error is thrown since it is missing (not created by
ods-enforcer-db-setup):
===
Sep 4 12:31:22 obsd-amd64-t01 ods-signerd: [file] unable to stat file /var/opendnssec/enforcer/zones.xml: ods_fopen() failed
===

Is it standard operating procedure to get that error on a fresh install, and
then making the system happy with the addition of the first zone?
--
Patrik Lundin
Berry A.W. van Halderen
2016-09-05 12:08:13 UTC
Permalink
This post might be inappropriate. Click to display it.
Patrik Lundin
2016-09-06 16:16:06 UTC
Permalink
Post by Berry A.W. van Halderen
[...]
Thanks for taking the time to share information regarding the current
state off affairs :).
Post by Berry A.W. van Halderen
Post by Patrik Lundin
If the goal is to not have two places that may get out of sync, why not have
the signer fetch information directly from the database?
The zones.xml solution is not holy. And the current solution is very
much under discussion. There are some drawbacks. The current signer
does not need to know anything about the enforcer datastructures and
operation. Synchronization between enforcer and signer is explicit,
so the enforcer 'tells' the signer when there are updates and the signer
does not need to monitor for changes.
Our database transactions can not be real simple, since there is only
one process doing changes.
It is possible to run signer and enforcer on different systems, without
shared filesystem. It is not unthinkable to make it possible to split
the signing over multiple machines in future.
Just so I am following: is the above statement that it is possible to
run signer/enforcer on different machines without a shared filesystem
possible today? Or did you mean that it is possible given that the use
of a file for synchronization (zones.xml) is traded for some other
solution?
Post by Berry A.W. van Halderen
Post by Patrik Lundin
Finally, what is the appropriate thing to do with zones.xml on a fresh install?
I notice an error is thrown since it is missing (not created by
===
Sep 4 12:31:22 obsd-amd64-t01 ods-signerd: [file] unable to stat file /var/opendnssec/enforcer/zones.xml: ods_fopen() failed
===
Is it standard operating procedure to get that error on a fresh install, and
then making the system happy with the addition of the first zone?
I think that is a proper procedure for now. Maybe it would be better
for the default "make install" to create the zones.xml? I think
most people still just ignore this message. In many use cases the
zonelist.xml (whether empty or not) is immediately imported and at
this time the zones.xml is created. For pure CLI use, a human will
start with the first zone. But it would be better that no warning
was generated here in this case.
Thanks for the info. At this point I have a bunch of diffs against
2.0.1 (as well as some runtime observations). I feel it would be
good to discuss them prior to creating PRs since some may be
interesting for merging upstream while others wont. Is there a
suitable way for doing this? I could post on this this list but I am
afraid it would cause a bunch of uninteresting noice for other members.
--
Patrik Lundin
Patrik Lundin
2016-09-14 17:33:18 UTC
Permalink
Post by Patrik Lundin
Thanks for the info. At this point I have a bunch of diffs against
2.0.1 (as well as some runtime observations). I feel it would be
good to discuss them prior to creating PRs since some may be
interesting for merging upstream while others wont. Is there a
suitable way for doing this? I could post on this this list but I am
afraid it would cause a bunch of uninteresting noice for other members.
Given the lack of response I'll just use this list for the followup.

Here is the error and warnings produced by the build and my attempts at
fixing them.

First the error and warnings from building:
===
depbase=`echo ods-enforcerd.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../common -I../../common -I../../common -I./../../libhsm/src/lib -I./../../libhsm/src/lib -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include -I/usr/include -O2 -pipe -pedantic -Wall -pthread -fno-strict-aliasing -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-security -Wstrict-aliasing -Wpacked -Winit-self -Wmissing-include-dirs -Wreturn-type -Wno-format-nonliteral -Wno-format-y2k -Wno-unused-function -Wno-unused-variable -Wno-sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=format-nonliteral -Wno-error=format-y2k -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -MT ods-enforcerd.o -MD -MP -MF $depbase.Tpo -c -o ods-enforcerd.o ods-enforcerd.c && mv -f $depbase.Tpo $depbase.Po
In file included from ./daemon/cmdhandler.h:36,
from daemon/engine.h:37,
from ods-enforcerd.c:37:
./scheduler/schedule.h:50: error: expected specifier-qualifier-list before 'pthread_cond_t'
In file included from daemon/engine.h:37,
from ods-enforcerd.c:37:
./daemon/cmdhandler.h:49: error: expected specifier-qualifier-list before 'pthread_t'
In file included from daemon/engine.h:38,
from ods-enforcerd.c:37:
./daemon/worker.h:45: error: expected specifier-qualifier-list before 'pthread_t'
In file included from ods-enforcerd.c:37:
daemon/engine.h:69: error: expected specifier-qualifier-list before 'pthread_cond_t'
*** Error 1 in enforcer/src (Makefile:1368 'ods-enforcerd.o')
*** Error 1 in enforcer/src (Makefile:1468 'all-recursive')
*** Error 1 in enforcer (Makefile:491 'all-recursive')
*** Error 1 in /home/pobj/opendnssec-2.0.1-sqlite3/opendnssec-2.0.1 (Makefile:539 'all-recursive')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2679 '/usr/ports/pobj/opendnssec-2.0.1-sqlite3/.build_done')
*** Error 1 in /usr/ports/security/opendnssec (/usr/ports/infrastructure/mk/bsd.port.mk:2397 'build')
===

Fixed with the following include:
===
--- enforcer/src/scheduler/schedule.h.orig Sun Sep 4 16:11:36 2016
+++ enforcer/src/scheduler/schedule.h Sun Sep 4 16:11:55 2016
@@ -36,6 +36,7 @@

#include <time.h>
#include <ldns/ldns.h>
+#include <pthread.h>

#include "scheduler/task.h"
#include "status.h"
===

Secondly some warnings thrown regarding unsupported push/pop GCC magic:
===
hsmutil.c:107: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
hsmutil.c:193: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
===

These I am not sure how to deal with in an upstream-compatible way. This seemed
to be caused by the use of "#pragma GCC diagnostic push/pop" calls which from what I
can tell are not supported by GCC 4.2.1.

Locally I can just remove all the #pragma GCC diagnostic stuff:
===
--- libhsm/src/bin/hsmutil.c.orig Sun Sep 4 16:30:20 2016
+++ libhsm/src/bin/hsmutil.c Sun Sep 4 16:31:34 2016
@@ -104,8 +104,6 @@ cmd_logout ()
return 0;
}

-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
static int
cmd_list (int argc, char *argv[])
{
@@ -190,7 +188,6 @@ cmd_list (int argc, char *argv[])

return 0;
}
-#pragma GCC diagnostic pop

static int
cmd_generate (int argc, char *argv[])
===

I notice the build is done using "-Wno-format-nonliteral" which i guess
disables this kind of warnings anyway, and is the only option I can find traces
of in the tar.gz.

Next up:
===
parser/addnsparser.c:381: warning: passing argument 2 of 'parse_addns_tsig_static' discards qualifiers from pointer target type
===

This was a bit tricky. Reading the code it seemed the second argument to
parse_addns_tsig_static() is declared as a "char*" and the argument being
passed was cast to that: (char *)"//Adapter/DNS/TSIG".

After fiddling around with the build flags I could narrow the warning down to
the combinariton of the flags "-O2 -Wwrite-strings". The warning disappears by
defining the argument as a const:
===
--- signer/src/parser/addnsparser.c.orig Sun Sep 4 21:49:08 2016
+++ signer/src/parser/addnsparser.c Sun Sep 4 21:49:39 2016
@@ -231,7 +231,7 @@ parse_addns_acl(const char* filename,
*/
static tsig_type*
parse_addns_tsig_static(const char* filename,
- char* expr)
+ const char* expr)
{
tsig_type* tsig = NULL;
tsig_type* new_tsig = NULL;
===

This feels a bit off, since the argument and function declaration now
mismatch code-wise.
Leaving it out there for upstream feedback.

Next up, some time_t inconsistencies:
===
wire/axfr.c:112: warning: format '%ld' expects type 'long int', but argument 4 has type 'time_t'
wire/axfr.c:112: warning: format '%ld' expects type 'long int', but argument 5 has type 'time_t'
===

On modern OpenBSD time_t is a "long long". I am not sure all target platforms
of opendnssec supports "long long", but if it does I guess one solution is to
just cast the value to "long long" instead since it should fit anything that
fits in a "long":
===
--- signer/src/wire/axfr.c.orig Sun Sep 4 23:18:13 2016
+++ signer/src/wire/axfr.c Sun Sep 4 23:18:44 2016
@@ -108,8 +108,8 @@ soa_request(query_type* q, engine_type* engine)
expire = q->zone->xfrd->serial_xfr_acquired;
expire += ldns_rdf2native_int32(ldns_rr_rdf(rr, SE_SOA_RDATA_EXPIRE));
if (expire < time_now()) {
- ods_log_warning("[%s] zone %s expired at %ld, and it is now %ld: "
- "not serving soa", axfr_str, q->zone->name, expire, time_now());
+ ods_log_warning("[%s] zone %s expired at %lld, and it is now %lld: "
+ "not serving soa", axfr_str, q->zone->name, (long long)expire, (long long)time_now());
ldns_rr_free(rr);
buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL);
ods_fclose(fd);
===

Next up: another set of the #pragma warnings. See above.
===
utils/kc_helper.c:57: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
utils/kc_helper.c:85: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
===

Patched:
===
--- enforcer/src/utils/kc_helper.c.orig Sun Sep 4 22:55:07 2016
+++ enforcer/src/utils/kc_helper.c Sun Sep 4 22:55:55 2016
@@ -54,8 +54,6 @@ void log_init(int facility, const char *program_name)
}

/* As far as possible we send messages both to syslog and STDOUT */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
void dual_log(const char *format, ...) {

/* If the variable arg list is bad then random errors can occur */
@@ -82,7 +80,6 @@ void dual_log(const char *format, ...) {
va_end(args);
va_end(args2);
}
-#pragma GCC diagnostic pop

/* Check an XML file against its rng */
int check_rng(const char *filename, const char *rngfilename, int verbose)
===

Then there is another time_t related warning:
===
hsmkey/hsm_key_factory.c:195: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'time_t'
===

Fixed like so:
===
--- enforcer/src/hsmkey/hsm_key_factory.c.orig Sun Sep 4 22:58:21 2016
+++ enforcer/src/hsmkey/hsm_key_factory.c Sun Sep 4 23:15:11 2016
@@ -189,8 +189,8 @@ void hsm_key_factory_generate(engine_type* engine, con
ods_log_info("%lu zone(s) found on policy <unknown>", num_zones);
}
ods_log_info("[hsm_key_factory_generate] %lu keys needed for %lu "
- "zones covering %lu seconds, generating %lu keys for policy %s",
- generate_keys, num_zones, duration,
+ "zones covering %lld seconds, generating %lu keys for policy %s",
+ generate_keys, num_zones, (long long)duration,
(unsigned long)(generate_keys-num_keys), /* This is safe because we checked num_keys < generate_keys */
policy_name(policy));
generate_keys -= num_keys;
===

A warning regarding implicit declaration:
===
keystate/keystate_ds_submit_task.c:51: warning: implicit declaration of function 'flush_enforce_task'
===

Fixed by adding an include:
===
--- enforcer/src/keystate/keystate_ds_submit_task.c.orig Sun Sep 4 23:20:37 2016
+++ enforcer/src/keystate/keystate_ds_submit_task.c Sun Sep 4 23:23:47 2016
@@ -33,6 +33,7 @@
#include "daemon/engine.h"
#include "duration.h"
#include "keystate/keystate_ds.h"
+#include "enforcer/enforce_task.h"

#include "keystate/keystate_ds_submit_task.h"

===

Then there are a bunch of warnings regarding const variables losing the const
when passed to a function:
===
keystate/key_purge.c:166: warning: passing argument 1 of 'key_state_delete' discards qualifiers from pointer target type
keystate/key_purge.c:167: warning: passing argument 1 of 'key_state_delete' discards qualifiers from pointer target type
keystate/key_purge.c:168: warning: passing argument 1 of 'key_state_delete' discards qualifiers from pointer target type
keystate/key_purge.c:169: warning: passing argument 1 of 'key_state_delete' discards qualifiers from pointer target type
===

The solution might be to make the function take a const instead, but not sure about this, feedback needed:
===
--- enforcer/src/db/key_state.c.orig Sun Sep 4 23:45:35 2016
+++ enforcer/src/db/key_state.c Sun Sep 4 23:46:05 2016
@@ -828,7 +828,7 @@ int key_state_update(key_state_t* key_state) {
return ret;
}

-int key_state_delete(key_state_t* key_state) {
+int key_state_delete(const key_state_t* key_state) {
db_clause_list_t* clause_list;
db_clause_t* clause;
int ret;

--- enforcer/src/db/key_state.h.orig Sun Sep 4 23:39:23 2016
+++ enforcer/src/db/key_state.h Sun Sep 4 23:39:47 2016
@@ -254,7 +254,7 @@ int key_state_update(key_state_t* key_state);
* \param[in] key_state a key_state_t pointer.
* \return DB_ERROR_* on failure, otherwise DB_OK.
*/
-int key_state_delete(key_state_t* key_state);
+int key_state_delete(const key_state_t* key_state);

/**
* A list of key state objects.
===


An initialization warning:
===
keystate/key_purge.c:48: warning: 'state' may be used uninitialized in this function
===

Fixed by:
===
--- enforcer/src/keystate/key_purge.c.orig Sun Sep 4 23:47:05 2016
+++ enforcer/src/keystate/key_purge.c Sun Sep 4 23:47:21 2016
@@ -45,7 +45,7 @@ int removeDeadKeysNow(int sockfd, db_connection_t *dbc
int key_purgable, cmp;
int zone_key_purgable;
unsigned int j;
- const key_state_t* state;
+ const key_state_t* state = NULL;
key_data_list_t *key_list = NULL;
key_data_t** keylist = NULL;
key_dependency_list_t *deplist = NULL;
===

Then there is another case of const-juggling:
===
signconf/signconf.c:88: warning: passing argument 1 of 'policy_free' discards qualifiers from pointer target type
signconf/signconf.c:111: warning: passing argument 1 of 'policy_free' discards qualifiers from pointer target type
===

I believe I first tried making the function take a const which then caused a
slew of new warnings, so maby the right solution is to not declare the variable
as const:
===
--- enforcer/src/signconf/signconf.c.orig Mon Sep 5 00:09:06 2016
+++ enforcer/src/signconf/signconf.c Mon Sep 5 00:09:23 2016
@@ -57,7 +57,7 @@ int signconf_export_all(int sockfd, const db_connectio
zone_list_t* zone_list;
zone_t* zone;
int ret;
- const policy_t* policy = NULL;
+ policy_t* policy = NULL;
int cmp;
int change = 0;

===

Then there is another uninitialized variable:
===
enforcer/enforcer.c:2637: warning: 'state' may be used uninitialized in this function
===

Patch:
===
--- enforcer/src/enforcer/enforcer.c.orig Mon Sep 5 00:11:29 2016
+++ enforcer/src/enforcer/enforcer.c Mon Sep 5 00:11:51 2016
@@ -2634,7 +2634,7 @@ removeDeadKeys(db_connection_t *dbconn, key_data_t** k
size_t i, deplist2_size = 0;
int key_purgable, cmp;
unsigned int j;
- const key_state_t* state;
+ const key_state_t* state = NULL;
key_dependency_t **deplist2 = NULL;

assert(keylist);
===

Finally there are some warnings thrown when building with -pedantic, these I am
not sure how to properly deal with (the first two being a result of native
calls to strlcat/strlcpy and the last one I am not sure how to properly
decipher:
===
strlcat.c:22: warning: ISO C forbids an empty source file
strlcpy.c:22: warning: ISO C forbids an empty source file
libhsm.c:289: warning: ISO C forbids conversion of object pointer to function pointer type
===

Next up is the result of me trying to run tests. It appears the file
test.sqlite is missing, is this by design? It is present in the git repo.
===
rm -f test.db
sqlite3 test.db < ./test.sqlite
/bin/sh: cannot open ./test.sqlite: No such file or directory
*** Error 1 in enforcer/src/db/test (Makefile:786 'regress-db')
*** Error 1 in enforcer/src (Makefile:1468 'check-recursive')
*** Error 1 in enforcer (Makefile:491 'check-recursive')
*** Error 1 in /home/pobj/opendnssec-2.0.1-sqlite3/opendnssec-2.0.1 (Makefile:539 'check-recursive')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2713 '/usr/ports/pobj/opendnssec-2.0.1-sqlite3/.test_done')
*** Error 1 in /usr/ports/security/opendnssec (/usr/ports/infrastructure/mk/bsd.port.mk:2397 'test')
===

Some questions raised during runtime:
===
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [cmdhandler] unable to create, bind() failed: No such file or directory
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [engine] create command handler to /var/run/opendnssec/enforcer.sock failed
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: setup failed: Command handler error
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [engine] enforcer shutdown
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [engine] enforcerd (pid: 56729) stopped with exitcode 3
===

In OpenDNSSEC 1.4.10 the pid directory is created if it is missing (see
createPidDir() in enforcer/common/daemon_util.c. Is this supposed to be handled
by rc/init scripts in 2.x?

1.4.10: enforcer/common/daemon_util.c: createPidDir()
2.0.1: enforcer/src/daemon/cmdhandler.c: cmdhandler_create() does not create pid directory.

I also notice the directories /var/opendnssec/enforcer and
/var/opendnssec/signer are not created manually. Are these supposed to be
created by package maintaners:
===
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: [file] chown() /var/opendnssec/enforcer failed: No such file or directory
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: [engine] chdir to /var/opendnssec/enforcer failed: No such file or directory
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: setup failed: Change directory failed
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: [engine] enforcer shutdown
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: [engine] enforcerd (pid: 94894) stopped with exitcode 3
===

... and:

===
Sep 4 12:30:14 obsd-amd64-t01 ods-signerd: [file] chown() /var/opendnssec/signer failed: No such file or directory
Sep 4 12:30:14 obsd-amd64-t01 ods-signerd: [engine] setup: unable to chdir to /var/opendnssec/signer (No such file or directory)
Sep 4 12:30:14 obsd-amd64-t01 ods-signerd: [engine] setup failed: Change directory failed
===

Finally it was the question of the missing zones.xml file, but this has been
discussed with Berry earlier, so for now the right thing is to have this error
be a part of an initial setup. I was thinking maby this file could be created
by the init script if missing, but I am worried this might have implications
when the goal is the do a migration from 1.4.10.

The migration as described in enforcer/utils/1.4-2.0_db_convert/README.md uses
the missing file as a "lock" which is then resolved by copying in the
zonelist.xml. In this case creating an empty file might break the migration?
===
Sep 4 12:31:22 obsd-amd64-t01 ods-signerd: [file] unable to stat file /var/opendnssec/enforcer/zones.xml: ods_fopen() failed
Sep 4 12:31:22 obsd-amd64-t01 ods-signerd: [engine] signer started (version 2.0.1), pid 28483
===

Hope anything here is interesting to upstream. I can create pull requests
against 2.0/develop for anything deemed suitable and welcome feedback on
anything even if not suitable for upstream merging.
--
Patrik Lundin
Berry A.W. van Halderen
2016-09-15 07:55:16 UTC
Permalink
Post by Patrik Lundin
Here is the error and warnings produced by the build and my attempts at
fixing them.
===
depbase=`echo ods-enforcerd.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc
-std=gnu99 -DHAVE_CONFIG_H -I. -I../../common -I../../common
-I../../common -I./../../libhsm/src/lib -I./../../libhsm/src/lib
-I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include
-I/usr/include -O2 -pipe -pedantic -Wall -pthread -fno-strict-aliasing
-Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-unused-parameter
-Wno-missing-field-initializers -Wformat=2 -Wcast-align
-Wformat-security -Wstrict-aliasing -Wpacked -Winit-self
-Wmissing-include-dirs -Wreturn-type -Wno-format-nonliteral
-Wno-format-y2k -Wno-unused-function -Wno-unused-variable
-Wno-sign-compare -Wno-error=unused-parameter
-Wno-error=missing-field-initializers -Wno-error=format-nonliteral
-Wno-error=format-y2k -Wno-error=unused-function
-Wno-error=unused-variable -Wno-error=sign-compare -MT ods-enforcerd.o
-MD -MP -MF $depbase.Tpo -c -o ods-enforcerd.o ods-enforcerd.c && mv -f
$depbase.Tpo $depbase.Po
Post by Patrik Lundin
In file included from ./daemon/cmdhandler.h:36,
from daemon/engine.h:37,
===
--- enforcer/src/scheduler/schedule.h.orig Sun Sep 4 16:11:36 2016
+++ enforcer/src/scheduler/schedule.h Sun Sep 4 16:11:55 2016
@@ -36,6 +36,7 @@
#include <time.h>
#include <ldns/ldns.h>
+#include <pthread.h>
#include "scheduler/task.h"
#include "status.h"
===
That's on the spot (ie. quite right change).
Post by Patrik Lundin
===
hsmutil.c:107: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
Post by Patrik Lundin
hsmutil.c:193: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
Post by Patrik Lundin
===
These I am not sure how to deal with in an upstream-compatible way. This seemed
to be caused by the use of "#pragma GCC diagnostic push/pop" calls which from what I
can tell are not supported by GCC 4.2.1.
I notice the build is done using "-Wno-format-nonliteral" which i guess
disables this kind of warnings anyway, and is the only option I can find traces
of in the tar.gz.
Yes, it disables the warning in GCC. Need to look into it how the
pragma is to be left out for older GCC versions. Normally pragmas
ought to be ignored if the compiler does not understand it. Love
the exceptions...
Post by Patrik Lundin
===
parser/addnsparser.c:381: warning: passing argument 2 of
'parse_addns_tsig_static' discards qualifiers from pointer target type
Post by Patrik Lundin
===
This was a bit tricky. Reading the code it seemed the second argument to
parse_addns_tsig_static() is declared as a "char*" and the argument being
passed was cast to that: (char *)"//Adapter/DNS/TSIG".
After fiddling around with the build flags I could narrow the warning down to
the combinariton of the flags "-O2 -Wwrite-strings". The warning disappears by
===
--- signer/src/parser/addnsparser.c.orig Sun Sep 4 21:49:08 2016
+++ signer/src/parser/addnsparser.c Sun Sep 4 21:49:39 2016
@@ -231,7 +231,7 @@ parse_addns_acl(const char* filename,
*/
static tsig_type*
parse_addns_tsig_static(const char* filename,
- char* expr)
+ const char* expr)
{
tsig_type* tsig = NULL;
tsig_type* new_tsig = NULL;
===
This feels a bit off, since the argument and function declaration now
mismatch code-wise.
Leaving it out there for upstream feedback.
I think this can indeed be handled better by properly using const
versus non-const in the right places.
Post by Patrik Lundin
===
wire/axfr.c:112: warning: format '%ld' expects type 'long int', but
argument 4 has type 'time_t'
Post by Patrik Lundin
wire/axfr.c:112: warning: format '%ld' expects type 'long int', but
argument 5 has type 'time_t'
Post by Patrik Lundin
===
On modern OpenBSD time_t is a "long long". I am not sure all target platforms
of opendnssec supports "long long", but if it does I guess one
solution is to
Post by Patrik Lundin
just cast the value to "long long" instead since it should fit
anything that
Post by Patrik Lundin
===
--- signer/src/wire/axfr.c.orig Sun Sep 4 23:18:13 2016
+++ signer/src/wire/axfr.c Sun Sep 4 23:18:44 2016
@@ -108,8 +108,8 @@ soa_request(query_type* q, engine_type* engine)
expire = q->zone->xfrd->serial_xfr_acquired;
expire += ldns_rdf2native_int32(ldns_rr_rdf(rr,
SE_SOA_RDATA_EXPIRE));
Post by Patrik Lundin
if (expire < time_now()) {
- ods_log_warning("[%s] zone %s expired at %ld, and it is now %ld: "
- "not serving soa", axfr_str, q->zone->name, expire, time_now());
+ ods_log_warning("[%s] zone %s expired at %lld, and it is now %lld: "
+ "not serving soa", axfr_str, q->zone->name, (long
long)expire, (long long)time_now());
Post by Patrik Lundin
ldns_rr_free(rr);
buffer_pkt_set_rcode(q->buffer, LDNS_RCODE_SERVFAIL);
ods_fclose(fd);
===
Then again there might be platforms that no not have long-longs. This
needs some reviewing.
Post by Patrik Lundin
Next up: another set of the #pragma warnings. See above.
===
utils/kc_helper.c:57: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
Post by Patrik Lundin
utils/kc_helper.c:85: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
Post by Patrik Lundin
===
===
--- enforcer/src/utils/kc_helper.c.orig Sun Sep 4 22:55:07 2016
+++ enforcer/src/utils/kc_helper.c Sun Sep 4 22:55:55 2016
@@ -54,8 +54,6 @@ void log_init(int facility, const char *program_name)
}
/* As far as possible we send messages both to syslog and STDOUT */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
void dual_log(const char *format, ...) {
/* If the variable arg list is bad then random errors can occur */
@@ -82,7 +80,6 @@ void dual_log(const char *format, ...) {
va_end(args);
va_end(args2);
}
-#pragma GCC diagnostic pop
/* Check an XML file against its rng */
int check_rng(const char *filename, const char *rngfilename, int verbose)
===
===
hsmkey/hsm_key_factory.c:195: warning: format '%lu' expects type 'long
unsigned int', but argument 4 has type 'time_t'
Post by Patrik Lundin
===
===
--- enforcer/src/hsmkey/hsm_key_factory.c.orig Sun Sep 4 22:58:21 2016
+++ enforcer/src/hsmkey/hsm_key_factory.c Sun Sep 4 23:15:11 2016
@@ -189,8 +189,8 @@ void hsm_key_factory_generate(engine_type* engine, con
ods_log_info("%lu zone(s) found on policy <unknown>", num_zones);
}
ods_log_info("[hsm_key_factory_generate] %lu keys needed for %lu "
- "zones covering %lu seconds, generating %lu keys for policy %s",
- generate_keys, num_zones, duration,
+ "zones covering %lld seconds, generating %lu keys for policy %s",
+ generate_keys, num_zones, (long long)duration,
(unsigned long)(generate_keys-num_keys), /* This is safe
because we checked num_keys < generate_keys */
Post by Patrik Lundin
policy_name(policy));
generate_keys -= num_keys;
===
===
keystate/keystate_ds_submit_task.c:51: warning: implicit declaration
of function 'flush_enforce_task'
Post by Patrik Lundin
===
The change is fine, but I'm much surprised it was in. We regulary
check that there are NO warnings.
Post by Patrik Lundin
===
--- enforcer/src/keystate/keystate_ds_submit_task.c.orig Sun Sep 4 23:20:37 2016
+++ enforcer/src/keystate/keystate_ds_submit_task.c Sun Sep 4 23:23:47 2016
@@ -33,6 +33,7 @@
#include "daemon/engine.h"
#include "duration.h"
#include "keystate/keystate_ds.h"
+#include "enforcer/enforce_task.h"
#include "keystate/keystate_ds_submit_task.h"
===
Then there are a bunch of warnings regarding const variables losing the const
===
keystate/key_purge.c:166: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
keystate/key_purge.c:167: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
keystate/key_purge.c:168: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
keystate/key_purge.c:169: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
===
The solution might be to make the function take a const instead, but
not sure about this, feedback needed:

Yes, const needed in most places. There are some (more) problematic
items where passing it as const will cause another warning as it
is passed as a key-value into an ldns rbtree. Those functions do
not use const, but the value can be treated as such, hence an
explicit cast is needed then.
Post by Patrik Lundin
===
--- enforcer/src/db/key_state.c.orig Sun Sep 4 23:45:35 2016
+++ enforcer/src/db/key_state.c Sun Sep 4 23:46:05 2016
@@ -828,7 +828,7 @@ int key_state_update(key_state_t* key_state) {
return ret;
}
-int key_state_delete(key_state_t* key_state) {
+int key_state_delete(const key_state_t* key_state) {
db_clause_list_t* clause_list;
db_clause_t* clause;
int ret;
--- enforcer/src/db/key_state.h.orig Sun Sep 4 23:39:23 2016
+++ enforcer/src/db/key_state.h Sun Sep 4 23:39:47 2016
@@ -254,7 +254,7 @@ int key_state_update(key_state_t* key_state);
* \param[in] key_state a key_state_t pointer.
* \return DB_ERROR_* on failure, otherwise DB_OK.
*/
-int key_state_delete(key_state_t* key_state);
+int key_state_delete(const key_state_t* key_state);
/**
* A list of key state objects.
===
===
keystate/key_purge.c:48: warning: 'state' may be used uninitialized in this function
===
===
--- enforcer/src/keystate/key_purge.c.orig Sun Sep 4 23:47:05 2016
+++ enforcer/src/keystate/key_purge.c Sun Sep 4 23:47:21 2016
@@ -45,7 +45,7 @@ int removeDeadKeysNow(int sockfd, db_connection_t *dbc
int key_purgable, cmp;
int zone_key_purgable;
unsigned int j;
- const key_state_t* state;
+ const key_state_t* state = NULL;
key_data_list_t *key_list = NULL;
key_data_t** keylist = NULL;
key_dependency_list_t *deplist = NULL;
===
It is okay, but it is a false positive by the compiler. The compiler
improperly does not see that if a for loop goes from 0 to 4 and an
if handles all the cases, it will always have a value. The initializer
will actually hide a warning when the if would not handle all cases.
So here the initializer is actually working against us, and shutting
up the compiler is unfortunate. Nevertheless, the code could use
some cleaning up, so we'll can just put it in.
Post by Patrik Lundin
===
signconf/signconf.c:88: warning: passing argument 1 of 'policy_free'
discards qualifiers from pointer target type
Post by Patrik Lundin
signconf/signconf.c:111: warning: passing argument 1 of 'policy_free'
discards qualifiers from pointer target type
Post by Patrik Lundin
===
I believe I first tried making the function take a const which then caused a
slew of new warnings, so maby the right solution is to not declare the variable
===
--- enforcer/src/signconf/signconf.c.orig Mon Sep 5 00:09:06 2016
+++ enforcer/src/signconf/signconf.c Mon Sep 5 00:09:23 2016
@@ -57,7 +57,7 @@ int signconf_export_all(int sockfd, const db_connectio
zone_list_t* zone_list;
zone_t* zone;
int ret;
- const policy_t* policy = NULL;
+ policy_t* policy = NULL;
int cmp;
int change = 0;
===
===
enforcer/enforcer.c:2637: warning: 'state' may be used uninitialized in this function
===
===
--- enforcer/src/enforcer/enforcer.c.orig Mon Sep 5 00:11:29 2016
+++ enforcer/src/enforcer/enforcer.c Mon Sep 5 00:11:51 2016
@@ -2634,7 +2634,7 @@ removeDeadKeys(db_connection_t *dbconn,
key_data_t** k
Post by Patrik Lundin
size_t i, deplist2_size = 0;
int key_purgable, cmp;
unsigned int j;
- const key_state_t* state;
+ const key_state_t* state = NULL;
key_dependency_t **deplist2 = NULL;
assert(keylist);
===
Finally there are some warnings thrown when building with -pedantic, these I am
not sure how to properly deal with (the first two being a result of native
calls to strlcat/strlcpy and the last one I am not sure how to properly
===
strlcat.c:22: warning: ISO C forbids an empty source file
strlcpy.c:22: warning: ISO C forbids an empty source file
The C files should be optionally included by automake/autoconf
I think, rather then leave them empty.
Post by Patrik Lundin
libhsm.c:289: warning: ISO C forbids conversion of object pointer to function pointer type
This one is known, hopefully we can lift this in future, but it requires
some work in code we'd rather replease. It is part of
how the PKCS#11 interface works and requires some special C construct
to get rid off. I'd rather live with the warning for now than
to use the construct which I need to check on all systems first.
Post by Patrik Lundin
===
Next up is the result of me trying to run tests. It appears the file
test.sqlite is missing, is this by design? It is present in the git repo.
===
rm -f test.db
sqlite3 test.db < ./test.sqlite
/bin/sh: cannot open ./test.sqlite: No such file or directory
*** Error 1 in enforcer/src/db/test (Makefile:786 'regress-db')
*** Error 1 in enforcer/src (Makefile:1468 'check-recursive')
*** Error 1 in enforcer (Makefile:491 'check-recursive')
*** Error 1 in /home/pobj/opendnssec-2.0.1-sqlite3/opendnssec-2.0.1
(Makefile:539 'check-recursive')
Post by Patrik Lundin
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2713
'/usr/ports/pobj/opendnssec-2.0.1-sqlite3/.test_done')
Post by Patrik Lundin
*** Error 1 in /usr/ports/security/opendnssec
(/usr/ports/infrastructure/mk/bsd.port.mk:2397 'test')
Post by Patrik Lundin
===
Not be design, but I'd advice not to run these tests. They give a false
sense of correctness, as OpenDNSSEC is tested in a different
manner. This is just one source module being tested, and only in
parts. Not worth the effort.
Post by Patrik Lundin
===
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [cmdhandler] unable to
create, bind() failed: No such file or directory
Post by Patrik Lundin
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [engine] create command
handler to /var/run/opendnssec/enforcer.sock failed
Post by Patrik Lundin
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: setup failed: Command handler error
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [engine] enforcer shutdown
56729) stopped with exitcode 3
Post by Patrik Lundin
===
In OpenDNSSEC 1.4.10 the pid directory is created if it is missing (see
createPidDir() in enforcer/common/daemon_util.c. Is this supposed to be handled
by rc/init scripts in 2.x?
Yes.
Post by Patrik Lundin
1.4.10: enforcer/common/daemon_util.c: createPidDir()
2.0.1: enforcer/src/daemon/cmdhandler.c: cmdhandler_create() does not create pid directory.
I also notice the directories /var/opendnssec/enforcer and
/var/opendnssec/signer are not created manually. Are these supposed to be
===
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: [file] chown()
/var/opendnssec/enforcer failed: No such file or directory
Post by Patrik Lundin
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: [engine] chdir to
/var/opendnssec/enforcer failed: No such file or directory
Post by Patrik Lundin
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: setup failed: Change directory failed
Sep 4 11:30:47 obsd-amd64-t01 ods-enforcerd: [engine] enforcer shutdown
94894) stopped with exitcode 3
Post by Patrik Lundin
===
===
Sep 4 12:30:14 obsd-amd64-t01 ods-signerd: [file] chown()
/var/opendnssec/signer failed: No such file or directory
Post by Patrik Lundin
Sep 4 12:30:14 obsd-amd64-t01 ods-signerd: [engine] setup: unable to
chdir to /var/opendnssec/signer (No such file or directory)
Post by Patrik Lundin
Sep 4 12:30:14 obsd-amd64-t01 ods-signerd: [engine] setup failed: Change directory failed
===
Finally it was the question of the missing zones.xml file, but this has been
discussed with Berry earlier, so for now the right thing is to have this error
be a part of an initial setup. I was thinking maby this file could be created
by the init script if missing, but I am worried this might have implications
when the goal is the do a migration from 1.4.10.
The migration as described in
enforcer/utils/1.4-2.0_db_convert/README.md uses
Post by Patrik Lundin
the missing file as a "lock" which is then resolved by copying in the
zonelist.xml. In this case creating an empty file might break the migration?
===
Sep 4 12:31:22 obsd-amd64-t01 ods-signerd: [file] unable to stat file
/var/opendnssec/enforcer/zones.xml: ods_fopen() failed
Post by Patrik Lundin
Sep 4 12:31:22 obsd-amd64-t01 ods-signerd: [engine] signer started
(version 2.0.1), pid 28483
Post by Patrik Lundin
===
Hope anything here is interesting to upstream. I can create pull requests
against 2.0/develop for anything deemed suitable and welcome feedback on
anything even if not suitable for upstream merging.
Yes, we're interested, of course...

With kind regards,
Berry van Halderen
Patrik Lundin
2016-09-19 20:42:29 UTC
Permalink
Post by Berry A.W. van Halderen
Post by Patrik Lundin
--- enforcer/src/scheduler/schedule.h.orig Sun Sep 4 16:11:36 2016
+++ enforcer/src/scheduler/schedule.h Sun Sep 4 16:11:55 2016
@@ -36,6 +36,7 @@
#include <time.h>
#include <ldns/ldns.h>
+#include <pthread.h>
#include "scheduler/task.h"
#include "status.h"
===
That's on the spot (ie. quite right change).
https://github.com/opendnssec/opendnssec/pull/526
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
hsmutil.c:107: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
Post by Patrik Lundin
hsmutil.c:193: warning: expected [error|warning|ignored] after
'#pragma GCC diagnostic'
Post by Patrik Lundin
===
[...]
Post by Berry A.W. van Halderen
Yes, it disables the warning in GCC. Need to look into it how the
pragma is to be left out for older GCC versions. Normally pragmas
ought to be ignored if the compiler does not understand it. Love
the exceptions...
Guess I will just handle the pragma removal locally for now. If the
push/pop pragma was silently ignored the side effects would be wider
applications of the actually supported pragmas which the push/pop is
supposed to contain. This would probably be even less expected.
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
parser/addnsparser.c:381: warning: passing argument 2 of
'parse_addns_tsig_static' discards qualifiers from pointer target type
Post by Patrik Lundin
===
[...]
Post by Berry A.W. van Halderen
I think this can indeed be handled better by properly using const
versus non-const in the right places.
Have any input on where the "right places" are? If this is updated
upstream I could mirror those changes in the port as well. This is true
for all the other "const" things I have reported. It is hard to know
what directions are correct in the several places I have seen this far.
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
[...]
Post by Berry A.W. van Halderen
Then again there might be platforms that no not have long-longs. This
needs some reviewing.
https://github.com/opendnssec/opendnssec/pull/527
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
keystate/keystate_ds_submit_task.c:51: warning: implicit declaration
of function 'flush_enforce_task'
Post by Patrik Lundin
===
The change is fine, but I'm much surprised it was in. We regulary
check that there are NO warnings.
https://github.com/opendnssec/opendnssec/pull/528
Post by Berry A.W. van Halderen
Post by Patrik Lundin
Then there are a bunch of warnings regarding const variables losing
the const
Post by Patrik Lundin
===
keystate/key_purge.c:166: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
keystate/key_purge.c:167: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
keystate/key_purge.c:168: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
keystate/key_purge.c:169: warning: passing argument 1 of
'key_state_delete' discards qualifiers from pointer target type
Post by Patrik Lundin
===
The solution might be to make the function take a const instead, but
Yes, const needed in most places. There are some (more) problematic
items where passing it as const will cause another warning as it
is passed as a key-value into an ldns rbtree. Those functions do
not use const, but the value can be treated as such, hence an
explicit cast is needed then.
This is the same as the previous "const" question. I am not sure I am
placing "const" in the right places currently, given I do not know the
grand design goals of these interfaces.
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
keystate/key_purge.c:48: warning: 'state' may be used uninitialized in
this function
Post by Patrik Lundin
===
[...]
Post by Berry A.W. van Halderen
It is okay, but it is a false positive by the compiler. The compiler
improperly does not see that if a for loop goes from 0 to 4 and an
if handles all the cases, it will always have a value. The initializer
will actually hide a warning when the if would not handle all cases.
So here the initializer is actually working against us, and shutting
up the compiler is unfortunate. Nevertheless, the code could use
some cleaning up, so we'll can just put it in.
https://github.com/opendnssec/opendnssec/pull/529
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
signconf/signconf.c:88: warning: passing argument 1 of 'policy_free'
discards qualifiers from pointer target type
Post by Patrik Lundin
signconf/signconf.c:111: warning: passing argument 1 of 'policy_free'
discards qualifiers from pointer target type
Post by Patrik Lundin
===
I believe I first tried making the function take a const which then
caused a
Post by Patrik Lundin
slew of new warnings, so maby the right solution is to not declare the
variable
Post by Patrik Lundin
===
--- enforcer/src/signconf/signconf.c.orig Mon Sep 5 00:09:06 2016
+++ enforcer/src/signconf/signconf.c Mon Sep 5 00:09:23 2016
@@ -57,7 +57,7 @@ int signconf_export_all(int sockfd, const db_connectio
zone_list_t* zone_list;
zone_t* zone;
int ret;
- const policy_t* policy = NULL;
+ policy_t* policy = NULL;
int cmp;
int change = 0;
===
You could say these 'const' questions are a constant hassle ;).
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
enforcer/enforcer.c:2637: warning: 'state' may be used uninitialized
in this function
Post by Patrik Lundin
===
https://github.com/opendnssec/opendnssec/pull/530
Post by Berry A.W. van Halderen
Post by Patrik Lundin
Finally there are some warnings thrown when building with -pedantic,
these I am
Post by Patrik Lundin
not sure how to properly deal with (the first two being a result of native
calls to strlcat/strlcpy and the last one I am not sure how to properly
===
strlcat.c:22: warning: ISO C forbids an empty source file
strlcpy.c:22: warning: ISO C forbids an empty source file
The C files should be optionally included by automake/autoconf
I think, rather then leave them empty.
This sounds reasonable, do you have a specific diff in mind?
Post by Berry A.W. van Halderen
Post by Patrik Lundin
libhsm.c:289: warning: ISO C forbids conversion of object pointer to
function pointer type
This one is known, hopefully we can lift this in future, but it requires
some work in code we'd rather replease. It is part of
how the PKCS#11 interface works and requires some special C construct
to get rid off. I'd rather live with the warning for now than
to use the construct which I need to check on all systems first.
This is fine with me. As long as the warning is known and acknowledged I
am happy.
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
Next up is the result of me trying to run tests. It appears the file
test.sqlite is missing, is this by design? It is present in the git repo.
===
Not be design, but I'd advice not to run these tests. They give a false
sense of correctness, as OpenDNSSEC is tested in a different
manner. This is just one source module being tested, and only in
parts. Not worth the effort.
I'll skip the tests.
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [cmdhandler] unable to
create, bind() failed: No such file or directory
Post by Patrik Lundin
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [engine] create command
handler to /var/run/opendnssec/enforcer.sock failed
Post by Patrik Lundin
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: setup failed: Command
handler error
Post by Patrik Lundin
Sep 4 11:07:09 obsd-amd64-t01 ods-enforcerd: [engine] enforcer shutdown
56729) stopped with exitcode 3
Post by Patrik Lundin
===
In OpenDNSSEC 1.4.10 the pid directory is created if it is missing (see
createPidDir() in enforcer/common/daemon_util.c. Is this supposed to
be handled
Post by Patrik Lundin
by rc/init scripts in 2.x?
Yes.
I take it the "Yes" refers to all the missing directories I mentioned.
Thanks for the info :).
Post by Berry A.W. van Halderen
Post by Patrik Lundin
Finally it was the question of the missing zones.xml file, but this
has been
Post by Patrik Lundin
discussed with Berry earlier, so for now the right thing is to have
this error
Post by Patrik Lundin
be a part of an initial setup. I was thinking maby this file could be
created
Post by Patrik Lundin
by the init script if missing, but I am worried this might have
implications
Post by Patrik Lundin
when the goal is the do a migration from 1.4.10.
The migration as described in
enforcer/utils/1.4-2.0_db_convert/README.md uses
Post by Patrik Lundin
the missing file as a "lock" which is then resolved by copying in the
zonelist.xml. In this case creating an empty file might break the
migration?
Never got a response regarding this, but maby it was a silent
acknowledgement to just let it be missing :).
--
Patrik Lundin
Berry A.W. van Halderen
2016-09-15 07:28:29 UTC
Permalink
Post by Patrik Lundin
Post by Berry A.W. van Halderen
[...]
Thanks for taking the time to share information regarding the current
state off affairs :).
Post by Berry A.W. van Halderen
Post by Patrik Lundin
If the goal is to not have two places that may get out of sync, why not have
the signer fetch information directly from the database?
The zones.xml solution is not holy. And the current solution is very
much under discussion. There are some drawbacks. The current signer
does not need to know anything about the enforcer datastructures and
operation. Synchronization between enforcer and signer is explicit,
so the enforcer 'tells' the signer when there are updates and the signer
does not need to monitor for changes.
Our database transactions can not be real simple, since there is only
one process doing changes.
It is possible to run signer and enforcer on different systems, without
shared filesystem. It is not unthinkable to make it possible to split
the signing over multiple machines in future.
Yes, but you need to make tooling for it, to transfer the files, and
the enforcer calls the signer CLI to inform it of changes. You should
also handle that. So it is possible, but your tooling probably needs
to change again with new releases. Since the enforcer does not need
to do a lot, there is little need for it. It is more interesting
to be able to use multiple signers on multiple machines, which should
need some support for the enforcer.
At the moment I would not split enforcer and signer over multiple
machines, as this makes the set-up more fragile.
Post by Patrik Lundin
Just so I am following: is the above statement that it is possible to
run signer/enforcer on different machines without a shared filesystem
possible today? Or did you mean that it is possible given that the use
of a file for synchronization (zones.xml) is traded for some other
solution?
Post by Berry A.W. van Halderen
Post by Patrik Lundin
Finally, what is the appropriate thing to do with zones.xml on a fresh install?
I notice an error is thrown since it is missing (not created by
===
Sep 4 12:31:22 obsd-amd64-t01 ods-signerd: [file] unable to stat
file /var/opendnssec/enforcer/zones.xml: ods_fopen() failed
Post by Patrik Lundin
Post by Berry A.W. van Halderen
Post by Patrik Lundin
===
Is it standard operating procedure to get that error on a fresh install, and
then making the system happy with the addition of the first zone?
I think that is a proper procedure for now. Maybe it would be better
for the default "make install" to create the zones.xml? I think
most people still just ignore this message. In many use cases the
zonelist.xml (whether empty or not) is immediately imported and at
this time the zones.xml is created. For pure CLI use, a human will
start with the first zone. But it would be better that no warning
was generated here in this case.
Thanks for the info. At this point I have a bunch of diffs against
2.0.1 (as well as some runtime observations). I feel it would be
good to discuss them prior to creating PRs since some may be
interesting for merging upstream while others wont. Is there a
suitable way for doing this? I could post on this this list but I am
afraid it would cause a bunch of uninteresting noice for other members.
I'm not too worried about using the list for this for the moment. The
alternative would be to use Jira or a PR. If you use the same subject
in the mailing list that will make it easier for others.
If the list gets real busy, then we can change it.

\Berry
Berry A.W. van Halderen
2016-09-05 07:08:07 UTC
Permalink
Post by Patrik Lundin
I have recently started looking at upgrading the OpenBSD port of
OpenDNSSEC to 2.x, currently 2.0.1.
* When compared to 1.4.10 I notice that the ods-getconf tool is missing,
and this is not mentioned in
https://www.opendnssec.org/2016/07/opendnssec-2-0-0/. I have not used
that tool myself, but just wondering if the omission is by design or a
mistake.
It was introduced int 1.4.6 but is a rather obscure command. There are
more generic tools for it that are more appropriate. It has been left
out more-or-less on purpose, but I would not call it by design.
Post by Patrik Lundin
* When fixing errors/warnings in the build, what git branch should these
be merged against? There seems to be at least develop, master,
2.0/develop and 2.0/master to chose from.
develop and master are branches for current development, which will
become 2.1 probably. This is much of a moving target, it is most
appropriate to make patches against it, but probably you should use
either 2.0/develop or 2.0/master for bugfix patches and
error/warnings. Anything remotely looking like features or improvements
should go to plain develop branch.

In OpenDNSSEC, the biggest GIT model for development was chosen, which
includes develop and master for every version. For maintenance
releases like 2.0/master/develop there is little difference between
them. I would chose 2.0/develop.

With kind regards,
Berry van Halderen
Patrik Lundin
2016-09-06 16:04:37 UTC
Permalink
Post by Berry A.W. van Halderen
Post by Patrik Lundin
* When compared to 1.4.10 I notice that the ods-getconf tool is missing,
and this is not mentioned in
https://www.opendnssec.org/2016/07/opendnssec-2-0-0/. I have not used
that tool myself, but just wondering if the omission is by design or a
mistake.
It was introduced int 1.4.6 but is a rather obscure command. There are
more generic tools for it that are more appropriate. It has been left
out more-or-less on purpose, but I would not call it by design.
Sounds good to me, I just wanted to check.
Post by Berry A.W. van Halderen
Post by Patrik Lundin
* When fixing errors/warnings in the build, what git branch should these
be merged against? There seems to be at least develop, master,
2.0/develop and 2.0/master to chose from.
In OpenDNSSEC, the biggest GIT model for development was chosen, which
includes develop and master for every version. For maintenance
releases like 2.0/master/develop there is little difference between
them. I would chose 2.0/develop.
Thanks, I'll keep that in mind.
--
Patrik Lundin
Loading...