On donne les dates, on donne aussi les anciens blacklists
darcs-hash:20041028084830-d1718-f42c801b49dea2bb25952ebc5f770f7052364f14.gz
This commit is contained in:
parent
4a68c06a71
commit
7c5cede32f
1 changed files with 20 additions and 5 deletions
|
@ -36,7 +36,7 @@ class bl_upload_fw(gen_config) :
|
||||||
# Fichier
|
# Fichier
|
||||||
BL_UPLOAD = '/CRANS/confs/blacklist.cf'
|
BL_UPLOAD = '/CRANS/confs/blacklist.cf'
|
||||||
|
|
||||||
restart_cmd = '/etc/init.d/firewall blacklist'
|
restart_cmd = 'echo /etc/init.d/firewall blacklist'
|
||||||
|
|
||||||
def __str__(self) :
|
def __str__(self) :
|
||||||
return "blackliste upload firewall"
|
return "blackliste upload firewall"
|
||||||
|
@ -50,7 +50,22 @@ class bl_upload_fw(gen_config) :
|
||||||
for adh in liste :
|
for adh in liste :
|
||||||
self.anim.cycle()
|
self.anim.cycle()
|
||||||
for machine in adh.machines() :
|
for machine in adh.machines() :
|
||||||
bl = machine.blacklist_actif()
|
bl = machine.blacklist_all()
|
||||||
if 'upload' in bl and not 'bloq' in bl :
|
# 0 = présent, 1 = passé
|
||||||
upload.write( '%s:smtp,smtps,pop3,pop3s,imap,imaps,http\n' % machine.nom() )
|
for i in range(0,2):
|
||||||
upload.close()
|
# Si on est dans le passé, on commente la ligne
|
||||||
|
if i == 1:
|
||||||
|
commentaire = '#'
|
||||||
|
else:
|
||||||
|
commentaire = ''
|
||||||
|
# On regarde s'il y a une sanction d'upload
|
||||||
|
if 'upload' in bl[i]:
|
||||||
|
# Si on est dans le présent et que le type est bloqué, il n'existe plus
|
||||||
|
if i == 1 or not 'bloq' in bl[i] :
|
||||||
|
# Pour chaque sanction d'upload, on va écrire une ligne :
|
||||||
|
for sanction in bl[i]['upload']:
|
||||||
|
upload.write( '%s%s:smtp,smtps,pop3,pop3s,imap,imaps,http # %s:%s:\n' % (commentaire,
|
||||||
|
machine.nom(),
|
||||||
|
sanction[0].split(" ")[0],
|
||||||
|
sanction[1].split(" ")[0]))
|
||||||
|
upload.close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue