Skip to content

Commit

Permalink
ui: use single quotes for raw strings
Browse files Browse the repository at this point in the history
part of the previous commit. Missed this change.
  • Loading branch information
gustavo-iniguez-goya committed Nov 8, 2023
1 parent 6c25be1 commit c3dc1fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ui/opensnitch/desktop_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_locale(self):

def _parse_exec(self, cmd):
try:
is_flatpak = re.search(r"^/usr/[s]*bin/flatpak.*--command=([a-zA-Z0-9-_\/\.\+]+)", cmd)
is_flatpak = re.search(r'^/usr/[s]*bin/flatpak.*--command=([a-zA-Z0-9-_\/\.\+]+)', cmd)
if is_flatpak:
return is_flatpak.group(1)

Expand Down
2 changes: 1 addition & 1 deletion ui/opensnitch/dialogs/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def _get_combo_operator(self, combo, what_idx):
text = parts[len(parts)-1]
# ^(|.*\.)yahoo\.com
dsthost = r'\.'.join(text.split('.')).replace("*", "")
dsthost = r"^(|.*\.)%s" % dsthost[2:]
dsthost = r'^(|.*\.)%s' % dsthost[2:]
return Config.RULE_TYPE_REGEXP, Config.OPERAND_DEST_HOST, dsthost

elif combo.itemData(what_idx) == self.FIELD_REGEX_IP:
Expand Down
10 changes: 5 additions & 5 deletions ui/opensnitch/dialogs/ruleseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
class RulesEditorDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):

LOG_TAG = "[rules editor]"
classA_net = r"10\.\d{1,3}\.\d{1,3}\.\d{1,3}"
classB_net = r"172\.1[6-9]\.\d+\.\d+|172\.2[0-9]\.\d+\.\d+|172\.3[0-1]+\.\d{1,3}\.\d{1,3}"
classC_net = r"192\.168\.\d{1,3}\.\d{1,3}"
others_net = r"127\.\d{1,3}\.\d{1,3}\.\d{1,3}|169\.254\.\d{1,3}\.\d{1,3}"
multinets = r"2[32][23459]\.\d{1,3}\.\d{1,3}\.\d{1,3}"
classA_net = r'10\.\d{1,3}\.\d{1,3}\.\d{1,3}'
classB_net = r'172\.1[6-9]\.\d+\.\d+|172\.2[0-9]\.\d+\.\d+|172\.3[0-1]+\.\d{1,3}\.\d{1,3}'
classC_net = r'192\.168\.\d{1,3}\.\d{1,3}'
others_net = r'127\.\d{1,3}\.\d{1,3}\.\d{1,3}|169\.254\.\d{1,3}\.\d{1,3}'
multinets = r'2[32][23459]\.\d{1,3}\.\d{1,3}\.\d{1,3}'
MULTICAST_RANGE = "^(" + multinets + ")$"
LAN_RANGES = "^(" + others_net + "|" + classC_net + "|" + classB_net + "|" + classA_net + "|::1|f[cde].*::.*)$"
LAN_LABEL = "LAN"
Expand Down
2 changes: 1 addition & 1 deletion ui/opensnitch/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def __init__(self):
for line in etcServices:
if line[0] == "#":
continue
g = re.search(r"([a-zA-Z0-9\-]+)( |\t)+([0-9]+)\/([a-zA-Z0-9\-]+)(.*)\n", line)
g = re.search(r'([a-zA-Z0-9\-]+)( |\t)+([0-9]+)\/([a-zA-Z0-9\-]+)(.*)\n', line)
if g:
self.srv_array.append("{0}/{1} {2}".format(
g.group(1),
Expand Down

0 comments on commit c3dc1fc

Please sign in to comment.