Skip to content

Commit

Permalink
Merge pull request #97 from cridin1/v3.0
Browse files Browse the repository at this point in the history
Fixing bugs on sqlite.connect and ruleset conversion
  • Loading branch information
wagga40 authored Jan 1, 2025
2 parents 864aa18 + 3ffef0f commit 24efd08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions zircolite.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def create_connection(self, db):
self.logger.debug(f"CONNECTING TO : {db}")
try:
if "?mode=memory&cache=shared" in db:
conn = sqlite3.connect(db, isolation_level=None)
conn = sqlite3.connect(db, isolation_level=None, uri=True)
conn.execute("PRAGMA journal_mode = MEMORY;")
conn.execute("PRAGMA synchronous = OFF;")
conn.execute("PRAGMA temp_store = MEMORY;")
Expand Down Expand Up @@ -1310,7 +1310,7 @@ def sigma_rules_to_ruleset(self, sigma_rules_list, pipelines):

if self.save_ruleset:
temp_ruleset_name = self.rand_ruleset_name(str(sigma_rules))
with open(temp_ruleset_name, "w") as outfile:
with open(temp_ruleset_name, "w", encoding="utf-8") as outfile:
outfile.write(
orjson.dumps(ruleset, option=orjson.OPT_INDENT_2).decode(
"utf-8"
Expand Down
4 changes: 2 additions & 2 deletions zircolite_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def create_connection(self, db):
self.logger.debug(f"CONNECTING TO : {db}")
try:
if "?mode=memory&cache=shared" in db:
conn = sqlite3.connect(db, isolation_level=None)
conn = sqlite3.connect(db, isolation_level=None, uri=True)
conn.execute('PRAGMA journal_mode = MEMORY;')
conn.execute('PRAGMA synchronous = OFF;')
conn.execute('PRAGMA temp_store = MEMORY;')
Expand Down Expand Up @@ -1106,7 +1106,7 @@ def sigma_rules_to_ruleset(self, sigma_rules_list, pipelines):

if self.save_ruleset:
temp_ruleset_name = self.rand_ruleset_name(str(sigma_rules))
with open(temp_ruleset_name, 'w') as outfile:
with open(temp_ruleset_name, 'w', encoding="utf-8") as outfile:
outfile.write(orjson.dumps(ruleset, option=orjson.OPT_INDENT_2).decode('utf-8'))
self.logger.info(f"{Fore.CYAN} [+] Saved ruleset as : {temp_ruleset_name}{Fore.RESET}")

Expand Down

0 comments on commit 24efd08

Please sign in to comment.