Skip to content

Commit 3b83978

Browse files
ui,popups: fixed dest host regexp
We were not matching the end of the domain, which could lead to allow more domains than expected. kudos to @fwdekker for reporting this issue. Details: #1264
1 parent fbdef16 commit 3b83978

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui/opensnitch/dialogs/prompt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ def _set_elide_text(self, widget, text, max_size=64):
226226
widget.setText(text)
227227

228228
def promptUser(self, connection, is_local, peer):
229-
self.reset_widgets()
230-
231229
# one at a time
232230
with self._lock:
233231
# reset state
232+
self.reset_widgets()
234233
if self._tick_thread != None and self._tick_thread.is_alive():
235234
self._tick_thread.join()
235+
236236
self._cfg.reload()
237237
self._tick = int(self._cfg.getSettings(self._cfg.DEFAULT_TIMEOUT_KEY)) if self._cfg.hasKey(self._cfg.DEFAULT_TIMEOUT_KEY) else self.DEFAULT_TIMEOUT
238238
self._tick_thread = threading.Thread(target=self._timeout_worker)
@@ -647,7 +647,7 @@ def _get_combo_operator(self, combo, what_idx, con):
647647
text = parts[len(parts)-1]
648648
# ^(|.*\.)yahoo\.com
649649
dsthost = r'\.'.join(text.split('.')).replace("*", "")
650-
dsthost = r'^(|.*\.)%s' % dsthost[2:]
650+
dsthost = r'^(|.*\.)%s$' % dsthost[2:]
651651
return Config.RULE_TYPE_REGEXP, Config.OPERAND_DEST_HOST, dsthost
652652

653653
elif combo.itemData(what_idx) == self.FIELD_REGEX_IP:

0 commit comments

Comments
 (0)