1 |
commit: 183aaaf64658625cb006b7cadb33e3a27e8fa496 |
2 |
Author: Mike Frysinger <vapier <AT> chromium <DOT> org> |
3 |
AuthorDate: Tue Feb 9 15:48:43 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 9 15:58:04 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=183aaaf6 |
7 |
|
8 |
net-firewall/ebtables: switch init to checkpath #603268 |
9 |
|
10 |
This makes the code a little simpler & more robust, and avoids |
11 |
creating /var paths at install time. |
12 |
|
13 |
Fixes: https://bugs.gentoo.org/603268 |
14 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
15 |
|
16 |
net-firewall/ebtables/ebtables-2.0.11-r3.ebuild | 1 - |
17 |
net-firewall/ebtables/files/ebtables.initd-r1 | 5 +++-- |
18 |
2 files changed, 3 insertions(+), 3 deletions(-) |
19 |
|
20 |
diff --git a/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild b/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild |
21 |
index 798135864de..467b9d7f3fd 100644 |
22 |
--- a/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild |
23 |
+++ b/net-firewall/ebtables/ebtables-2.0.11-r3.ebuild |
24 |
@@ -70,7 +70,6 @@ src_install() { |
25 |
|
26 |
if ! use static; then |
27 |
emake DESTDIR="${D}" install |
28 |
- keepdir /var/lib/ebtables/ |
29 |
newinitd "${FILESDIR}"/ebtables.initd-r1 ebtables |
30 |
newconfd "${FILESDIR}"/ebtables.confd-r1 ebtables |
31 |
|
32 |
|
33 |
diff --git a/net-firewall/ebtables/files/ebtables.initd-r1 b/net-firewall/ebtables/files/ebtables.initd-r1 |
34 |
index 1860187b7de..bdc0987b1b2 100644 |
35 |
--- a/net-firewall/ebtables/files/ebtables.initd-r1 |
36 |
+++ b/net-firewall/ebtables/files/ebtables.initd-r1 |
37 |
@@ -13,6 +13,7 @@ depend() { |
38 |
} |
39 |
|
40 |
ebtables_tables() { |
41 |
+ local table |
42 |
for table in filter nat broute; do |
43 |
if ${ebtables_bin} -t ${table} -L > /dev/null 2>&1; then |
44 |
printf '%s' "${table} " |
45 |
@@ -79,8 +80,8 @@ reload() { |
46 |
|
47 |
save() { |
48 |
ebegin "Saving ebtables state" |
49 |
- touch "${ebtables_save}" |
50 |
- chmod 0600 "${ebtables_save}" |
51 |
+ checkpath -d -m 0755 "${ebtables_save%/*}" |
52 |
+ checkpath -f -m 0600 "${ebtables_save}" |
53 |
${ebtables_bin}-save $(ebtables_tables) ${SAVE_RESTORE_OPTIONS} > "${ebtables_save}" |
54 |
eend $? |
55 |
} |