firewall: dos2unix

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2022-05-29 17:54:31 +08:00
parent 7ff2480d40
commit dccc926e32
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 38 additions and 38 deletions
package/network/config/firewall/patches

@ -1,38 +1,38 @@
From df1306a96127e91ff2d513a0a67345baaf61d113 Mon Sep 17 00:00:00 2001 From df1306a96127e91ff2d513a0a67345baaf61d113 Mon Sep 17 00:00:00 2001
From: Florian Eckert <fe@dev.tdt.de> From: Florian Eckert <fe@dev.tdt.de>
Date: Fri, 19 Nov 2021 09:51:02 +0100 Date: Fri, 19 Nov 2021 09:51:02 +0100
Subject: [PATCH] firewall3: fix locking issue Subject: [PATCH] firewall3: fix locking issue
By calling the command 'fw3 reload' several times at the same time, I 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 noticed that the locking was not working properly. It happened from time
to time that some firewall rules were present twice in the system! to time that some firewall rules were present twice in the system!
By removing the 'unlink' systemcall, this error no longer occurred on my By removing the 'unlink' systemcall, this error no longer occurred on my
systems. systems.
Since fw3 does not run as a service, it makes no sense to delete this 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, lock file every time a filehandler is no longer open on this lock file,
because fw3 binary is not running. because fw3 binary is not running.
If fw3 does run as a service then we can remove this lock file on 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. service stop. But this is not the case for fw3.
Signed-off-by: Florian Eckert <fe@dev.tdt.de> Signed-off-by: Florian Eckert <fe@dev.tdt.de>
--- ---
utils.c | 1 - utils.c | 1 -
1 file changed, 1 deletion(-) 1 file changed, 1 deletion(-)
diff --git a/utils.c b/utils.c diff --git a/utils.c b/utils.c
index 17d5bf9..92e966c 100644 index 17d5bf9..92e966c 100644
--- a/utils.c --- a/utils.c
+++ b/utils.c +++ b/utils.c
@@ -397,7 +397,6 @@ fw3_unlock_path(int *fd, const char *lockpath) @@ -397,7 +397,6 @@ fw3_unlock_path(int *fd, const char *lockpath)
warn("Cannot release exclusive lock: %s", strerror(errno)); warn("Cannot release exclusive lock: %s", strerror(errno));
close(*fd); close(*fd);
- unlink(FW3_LOCKFILE); - unlink(FW3_LOCKFILE);
*fd = -1; *fd = -1;
} }
-- --
2.30.2 2.30.2