summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-05-27 10:45:05 +0000
committerErmal <eri@pfsense.org>2011-05-27 10:45:05 +0000
commit71070cc55fff338e93ed945e429b585acf72d4bb (patch)
treeddc7eaf437e1fb482fbc635d44dcb2de486beb85
parent224ddbadab18d56f6f6ffef408ff24f3c5161303 (diff)
downloadpfsense-71070cc55fff338e93ed945e429b585acf72d4bb.zip
pfsense-71070cc55fff338e93ed945e429b585acf72d4bb.tar.gz
Ticket #1545. Lock each dnsHost to be updated to prevent running two instances in parallell.
-rw-r--r--etc/inc/dyndns.class7
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index 01209b9..e155c20 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -98,7 +98,9 @@
$this->_debugFile = "{$g['varetc_path']}/dyndns_{$dnsIf}{$dnsService}" . escapeshellarg($dnsHost) . ".debug";
log_error("DynDns: updatedns() starting");
-
+
+ $dyndnslck = lock($dnsHost, LOCK_EX);
+
if (!$dnsService) $this->_error(2);
switch ($dnsService) {
case 'freedns':
@@ -128,6 +130,7 @@
// Ensure that we where able to lookup the IP
if(!is_ipaddr($this->_ifIP)) {
log_error("There was an error trying to determine the IP for interface - {$dnsIf}({$this->_if}). Probably interface has no ip or is down. Dyndns update not possible for {$dnsService}.");
+ unlock($dyndnslck);
return;
}
@@ -162,6 +165,8 @@
break;
}
}
+
+ unlock($dyndnslck);
}
/*
OpenPOWER on IntegriCloud