Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assertion error for superuser #289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lordlabuckdas
Copy link
Contributor

In test_snare_helpers_check_privileges.py, since a superuser would have (write) permissions for the root directory, 2 of the assertions fail.

So, I have used os.geteuid() to get the effective user ID and set self.privileges accordingly.

I have also removed the executable permissions for snare_helpers.py as it is not required.

@glaslos
Copy link
Member

glaslos commented Jun 12, 2021

I find this test a bit confusing. Are we testing here if we could run Snare on this system?

@lordlabuckdas
Copy link
Contributor Author

Yes, we're testing the check_privileges function which is used to create a directory for Snare and handle cases where the user does not have sufficient permissions to do so. I believe this makes Snare more non-root-user-friendly.
I agree that this test does not make much sense if Snare is intended to only be run as root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants