ReJeCtAll / naxsi

Automatically exported from code.google.com/p/naxsi
Other
0 stars 0 forks source link

Nasxi intercept #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In naxsi-ui configuration file, configure nx_intercept to use
   dbtype = sqlite
   data_path = /some_path/db/

2. Run nginx+naxsi in order to generate entries in nginx's error.log

3. Run nx_intercept in a directory different than /some_path/db/ 
   with -l in order to read nginx's error.log

What is the expected output? What do you see instead?
It is expected that nx_intercept populates the database with exceptions
and outputs something like:
880 exceptions stored into database.

Instead, an error occurs:
Traceback (most recent call last):
  File "nx_intercept.py", line 210, in <module>
    fill_db(logs_path, conf_path)
  File "nx_intercept.py", line 86, in fill_db
    wrapper.drop_database()
  File "/servers/sslaccel/naxsi-ui/NaxsiLib/SQLWrapper.py", line 101, in drop_database
    os.unlink(os.getcwd() + '/' + self.dbname)
OSError: [Errno 2] No such file or directory: 'other_path/naxsi_sig'

What version of the product are you using? On what operating system?
naxsi-ui 0.49

Please provide your nginx configuration any additional information below.

In NaxsiLib/SQLWrapper.py line 101 use dbpath instead of cwd:

--- a/nginx/naxsi/naxsi-ui-0.49/naxsi-ui/NaxsiLib/SQLWrapper.py
+++ b/nginx/naxsi/naxsi-ui-0.49/naxsi-ui/NaxsiLib/SQLWrapper.py
@@ -98,7 +98,7 @@ class SQLWrapper(object):
         if self.dbtype == 'mysql':
             self.__cursor.execute("DROP DATABASE IF EXISTS %s;" % self.dbname)
         elif self.dbtype == 'sqlite':
-            os.unlink(os.getcwd() + '/' + self.dbname)
+            os.unlink(self.dbpath + self.dbname)

     def create_db(self):
         if self.dbtype == 'mysql':

Original issue reported on code.google.com by carlos.l...@gmail.com on 30 Nov 2012 at 6:31

GoogleCodeExporter commented 8 years ago
I botched the issue name... sorry about that. Should be something like 
"nx_intercept.py SQLite db location bug".

Original comment by carlos.l...@gmail.com on 30 Nov 2012 at 6:33

GoogleCodeExporter commented 8 years ago
Hello,

Sorry for late reply :)
It is apparently related to your configuration, your data_path = /some_path/db/ 
should be either relative or absolute, but apparently it's not correct here.

Original comment by ori...@gmail.com on 7 Jan 2013 at 6:00

GoogleCodeExporter commented 8 years ago

Original comment by ori...@gmail.com on 17 Jan 2013 at 7:34