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 error produced by pfctl when no rules are returned #768

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

tschettervictor
Copy link
Collaborator

When adding a rdr rule, pfctl will error when it does not find any rules using pfctl -a rdr/jail -Psn;

Elsewhere in the script, this is solved by simply adding 2>/dev/null to not return errors. This PR simply adds the same functionality to the "load_rdr_rule" function.

This was referenced Dec 10, 2024
@tschettervictor
Copy link
Collaborator Author

tschettervictor commented Dec 10, 2024

#673 #644

This one took a while to solve, but I finally discovered that the error only happens when pfctl cannot find any rules using the Psn flags.

Copy link
Collaborator

@bmac2 bmac2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve

@bmac2 bmac2 merged commit 4c58fd9 into BastilleBSD:master Dec 17, 2024
1 check passed
@tschettervictor tschettervictor deleted the patch-5 branch December 17, 2024 03:03
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