summaryrefslogtreecommitdiffstats
path: root/contrib/openbsm/bin
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2013-02-28 01:24:24 +0000
committerpjd <pjd@FreeBSD.org>2013-02-28 01:24:24 +0000
commita7aacdcc59ec6c6ad46cda7cc6e549cf8ad57427 (patch)
treec1ce6ca680f3be4df581589e5a256548650805ff /contrib/openbsm/bin
parent9d861dbb5610d58af957b37050bea1b9e6cacf2b (diff)
downloadFreeBSD-src-a7aacdcc59ec6c6ad46cda7cc6e549cf8ad57427.zip
FreeBSD-src-a7aacdcc59ec6c6ad46cda7cc6e549cf8ad57427.tar.gz
When we are waiting for new trail files we may have been disconnected and
reconnected in the meantime. Check if reset is set before opening next trail file, as not doing so will result in sending OPEN message with the same file name twice and this is illegal - the second OPEN is send without first closing previous trail file.
Diffstat (limited to 'contrib/openbsm/bin')
-rw-r--r--contrib/openbsm/bin/auditdistd/sender.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/openbsm/bin/auditdistd/sender.c b/contrib/openbsm/bin/auditdistd/sender.c
index 256fbb1..ab90e6c 100644
--- a/contrib/openbsm/bin/auditdistd/sender.c
+++ b/contrib/openbsm/bin/auditdistd/sender.c
@@ -394,6 +394,7 @@ read_thread_wait(void)
mtx_lock(&adist_remote_mtx);
if (adhost->adh_reset) {
+reset:
adhost->adh_reset = false;
if (trail_filefd(adist_trail) != -1)
trail_close(adist_trail);
@@ -408,6 +409,14 @@ read_thread_wait(void)
while (trail_filefd(adist_trail) == -1) {
newfile = true;
wait_for_dir();
+ /*
+ * We may have been disconnected and reconnected in the
+ * meantime, check if reset is set.
+ */
+ mtx_lock(&adist_remote_mtx);
+ if (adhost->adh_reset)
+ goto reset;
+ mtx_unlock(&adist_remote_mtx);
if (trail_filefd(adist_trail) == -1)
trail_next(adist_trail);
}
OpenPOWER on IntegriCloud