Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Blanc
scripts
Commits
dd83999d
Commit
dd83999d
authored
May 01, 2013
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[firewall4] La liste d'ip donnée par générate est incomplète
parent
d447b954
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
gestion/gen_confs/firewall4.py
gestion/gen_confs/firewall4.py
+10
-4
gestion/gen_confs/ipset.py
gestion/gen_confs/ipset.py
+1
-1
No files found.
gestion/gen_confs/firewall4.py
View file @
dd83999d
...
...
@@ -282,7 +282,8 @@ class firewall_base(object) :
def
blacklist_maj
(
self
,
ips
):
"""Met à jours les blacklists pour les ip présentent dans la liste ``ips``"""
self
.
blacklist_hard_maj
(
ips
)
#self.blacklist_hard_maj(ips)
self
.
reload
(
'blacklist_hard'
)
def
raw_table
(
self
):
"""Génère les règles pour la table ``raw`` et remplis les chaines de la table"""
...
...
@@ -500,8 +501,12 @@ class firewall_komaz(firewall_base_routeur):
})
def
blacklist_maj
(
self
,
ips
):
self
.
blacklist_hard_maj
(
ips
)
self
.
blacklist_soft_maj
(
ips
)
#self.blacklist_hard_maj(ips)
#self.blacklist_soft_maj(ips)
#self.blacklist_upload_maj(ips)
self
.
reload
(
'blacklist_hard'
)
self
.
reload
(
'blacklist_soft'
)
self
.
reload
(
'blacklist_upload'
)
def
raw_table
(
self
):
return
...
...
@@ -1061,7 +1066,8 @@ class firewall_zamok(firewall_base):
def
blacklist_maj
(
self
,
ips
):
anim
(
'
\t
Mise à jour des blacklists'
)
self
.
blacklist_output
(
'filter'
,
apply
=
True
)
self
.
blacklist_hard_maj
(
ips
)
#self.blacklist_hard_maj(ips)
self
.
reload
(
'blacklist_hard'
)
print
OK
def
blacklist_output
(
self
,
table
=
None
,
apply
=
False
):
...
...
gestion/gen_confs/ipset.py
View file @
dd83999d
...
...
@@ -96,7 +96,7 @@ class Ipset(object):
self
.
flush
()
if
self
.
squeeze
:
self
.
destroy
()
except
IpsetError
:
pass
except
IpsetError
as
error
:
sys
.
stderr
.
write
(
"%s
\n
"
%
error
)
cmd
=
"cat %s | %s -R"
%
(
path
,
self
.
ipset
)
status
,
output
=
commands
.
getstatusoutput
(
cmd
)
if
status
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment