Skip to content

fix problem acquiring sqlite flock when running slips as root #2073

Description

@AlyaGomaa

in this PR #2063

Traceback (most recent call last):
File "/home/alya/Desktop/StratosphereLinuxIPS/./slips.py", line 64, in
slips.start()
File "/home/alya/Desktop/StratosphereLinuxIPS/slips/main.py", line 556, in start
self.db = DBManager(
File "/home/alya/Desktop/StratosphereLinuxIPS/slips_files/core/database/database_manager.py", line 110, in init
self.sqlite = SQLiteDB(self.logger, output_dir, main_pid)
File "/home/alya/Desktop/StratosphereLinuxIPS/slips_files/core/database/sqlite_db/database.py", line 48, in init
super().init(self.name.lower(), main_pid, self._flows_db)
File "/home/alya/Desktop/StratosphereLinuxIPS/slips_files/common/abstracts/isqlite.py", line 48, in init
self.connect(db_file)
File "/home/alya/Desktop/StratosphereLinuxIPS/slips_files/common/abstracts/isqlite.py", line 53, in connect
with self._acquire_flock():
File "/usr/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/home/alya/Desktop/StratosphereLinuxIPS/slips_files/common/abstracts/isqlite.py", line 92, in _acquire_flock
with self.sqlite_flock.acquire():
File "/usr/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/home/alya/Desktop/StratosphereLinuxIPS/slips_files/common/sqlite_flock.py", line 106, in acquire
self.lockfile_fd = open(self.lockfile_path, "w")
PermissionError: [Errno 13] Permission denied: '/tmp/slips/root_154695_sqlite_db.lock'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugA bug that needs to be fixed

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions