ACL Regex angepasst

Controlbyte für Schreiben
This commit is contained in:
2017-08-14 13:30:16 +02:00
parent f0eecb8930
commit 239cd9eee7

View File

@@ -58,7 +58,7 @@ procimg = "/dev/piControl0"
pyloadverion = "0.5.0" pyloadverion = "0.5.0"
rapcatalog = None rapcatalog = None
re_ipacl = "(([\\d\\*]{1,3}\\.){3}[\\d\\*]{1,3},[0-1] ?)+" re_ipacl = "(([\\d\\*]{1,3}\\.){3}[\\d\\*]{1,3},[0-1] ?)*"
def _ipmatch(ipaddress, dict_acl): def _ipmatch(ipaddress, dict_acl):
@@ -649,11 +649,13 @@ class RevPiSlaveDev(Thread):
elif cmd == b'SD' and self._acl == 1: elif cmd == b'SD' and self._acl == 1:
# Ausgänge empfangen, wenn acl es erlaubt # Ausgänge empfangen, wenn acl es erlaubt
# bCMiiii00000000b = 16 # bCMiiiic0000000b = 16
position = int.from_bytes(netcmd[3:5], byteorder="little") position = int.from_bytes(netcmd[3:5], byteorder="little")
length = int.from_bytes(netcmd[5:7], byteorder="little") length = int.from_bytes(netcmd[5:7], byteorder="little")
control = netcmd[7:8]
if control == b'\x1d' and length > 0:
try: try:
block = self._devcon.recv(length) block = self._devcon.recv(length)
except: except:
@@ -783,9 +785,7 @@ class RevPiSlaveDev(Thread):
fh_proc.seek(pos) fh_proc.seek(pos)
fh_proc.write(self.ey_dict[pos]) fh_proc.write(self.ey_dict[pos])
proginit.logger.error( proginit.logger.error("dirty shutdown of connection")
"dirty shutdown of connection"
)
fh_proc.close() fh_proc.close()
self._devcon.close() self._devcon.close()