From 617b64e5b7c66eb0253dd7dc6559ec87b99d8677 Mon Sep 17 00:00:00 2001 From: "Adam Polkosnik [fun]" Date: Mon, 26 Sep 2016 16:59:34 -0400 Subject: [PATCH] cd to the right directory before opening file (for the includes to work) --- yara_service/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yara_service/__init__.py b/yara_service/__init__.py index abe44f5a..f3934beb 100644 --- a/yara_service/__init__.py +++ b/yara_service/__init__.py @@ -163,10 +163,10 @@ def _compile_rules(sigdir, sigfiles, sfpath=""): sfname = str(os.path.basename(sfpath)) sfext = str(os.path.splitext(sfname)) old = os.getcwd() + os.chdir(dirname) try: with open(sigfile, "rt") as f: data = f.read() - os.chdir(dirname) except Exception as e: logger.exception("File cannot be opened: %s" % sigfile) raise ServiceConfigError(str(e))