summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2021-11-19 09:51:02 +0100
committerRui Salvaterra <rsalvaterra@gmail.com>2022-01-08 11:33:49 +0000
commitdf1306a96127e91ff2d513a0a67345baaf61d113 (patch)
tree1ed102ad66fb45495c109d1ab4aa5137c613b3fa
parent3624c3786601699b6e7f9d18209fad0d7c6fe4e9 (diff)
downloadfirewall3-df1306a96127e91ff2d513a0a67345baaf61d113.tar.gz
firewall3: fix locking issue
By calling the command 'fw3 reload' several times at the same time, I noticed that the locking was not working properly. It happened from time to time that some firewall rules were present twice in the system! By removing the 'unlink' systemcall, this error no longer occurred on my systems. Since fw3 does not run as a service, it makes no sense to delete this lock file every time a filehandler is no longer open on this lock file, because fw3 binary is not running. If fw3 does run as a service then we can remove this lock file on service stop. But this is not the case for fw3. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
-rw-r--r--utils.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/utils.c b/utils.c
index 17d5bf9..92e966c 100644
--- a/utils.c
+++ b/utils.c
@@ -397,7 +397,6 @@ fw3_unlock_path(int *fd, const char *lockpath)
warn("Cannot release exclusive lock: %s", strerror(errno));
close(*fd);
- unlink(FW3_LOCKFILE);
*fd = -1;
}