Fix ticket expiration check.

https://fedorahosted.org/bind-dyndb-ldap/ticket/131

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Always use task associated with ISC event instead of global inst->task.

This is necessary to prevent random crashes like:
REQUIRE(task->state == task_state_running) failed

https://fedorahosted.org/bind-dyndb-ldap/ticket/138

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Use "master" subdirectory for temporary files related to zones.

This allows us to separate zone and non-zone metadata and also to separate
master and (hypothetical) slave zones.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Escape directory names generated from zone names.

Previously root zone '.' and zone names with characters like '/' caused
scattering of temporary files all over dyndb-ldap working directory.

https://fedorahosted.org/bind-dyndb-ldap/ticket/122

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Create temporary directories with ug=rwx,o= permissions.

Zero group permissions do not allow to use POSIX ACLs which is
undesirable.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Fix root zone handling.

syncrepl_update() was buggy in a way which could cause accidental zone removal.

Test case: A server with two zones: '.' and 'test.'

Zone '.':
.     NS ns1.test.
.     NS ns2.test.
test. NS ns1.test.
test. NS ns2.test.

Zone 'test.':
test.     NS ns1.test.
test.     NS ns2.test.
ns1.test. A  192.0.2.1
ns2.test. A  192.0.2.2

Removing whole name 'test.' from zone '.' will cause removal of zone 'test.'
instead of removing NS records from zone '.'.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Update link to patches for BIND.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Update naming rules for working directories.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Clarify that idnsZoneActive attribute is not supported.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Update NEWS for upcoming 5.2 release.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Bump NVR to 5.2.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Update .gitignore to skip Eclipse .settings directory

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Rework locking in settings.c module.

Locking mechanism run_exclusive_enter()/exit() works correctly only if
all calls operate on the same task.

Locking was reworked to use ordinary mutex stored in settings_set_t
structure.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Rework locking around DNS views.

It turned out that previous usage of isc_task_beginexclusive() was
completely incorrect and didn't actually lock anything. As a result the
plugin was randomly crashing.

Code was reworked in a way that isc_task_beginexclusive() is always called on
inst->task and all isc_task_beginexclusive() calls are made from inside
of inst->task.

See comments in lock.c for more details.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Lock syncrepl queue avoid race between zones and resource records.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Fix deadlocks on shutdown caused by sync_*_wait() calls.

sync_event_wait() and sync_concurr_limit_wait() calls were updated to
check inst->exiting variable. This is necessary to prevent deadlocks
on shutdown, e.g. in situation where syncrepl queue is full
(sync_concurr_limit_wait() is blocking) and BIND receives SIGINT.

Both synchronization calls now fail with ISC_R_SHUTTINGDOWN
if LDAP instance is marked as "exiting".

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Update NEWS for upcoming 5.3 release.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Bump NVR to 5.3.

Signed-off-by: Petr Spacek <pspacek@redhat.com>
Add log message about initial LDAP synchronization.

Signed-off-by: Petr Spacek <pspacek@redhat.com>