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

config: Correctly match valueless parameters. Fixes #693 #793

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

bramton
Copy link
Contributor

@bramton bramton commented Jan 6, 2025

The current RE does not match valueless parameters properly. For instance, if the jail config file has a single line with allow.mount; the field in the AWK program will have the value allow.mount;. This is currently not matched due to the trailing ;. This PR allows for zero or one trailing ; in the field.

This resolves #693 and #702 (comment)

@tschettervictor
Copy link
Collaborator

What does the "config" command look like before and after this patch?

@bramton
Copy link
Contributor Author

bramton commented Jan 7, 2025

The behaviour of the config command is not changed. To give an example what this PR fixes consider the following fictive jail.conf file:

woot {
  host.hostname = woot;
  allow.mount;
  ip6 = enable;
}

Now if we run:

bastille config woot set allow.mount
bastille config woot set allow.mount

The resulting jail.conf now looks like this:

Before this PR

woot {
  host.hostname = woot;
  allow.mount;
  ip6 = enable;
  allow.mount;
  allow.mount;
}

After this PR

woot {
  host.hostname = woot;
  allow.mount;
  ip6 = enable;
}

@tschettervictor
Copy link
Collaborator

Ah. I was thinking of the "get" command, which worked ok for me. But you're referring to "set".

I see.
Let me try this.

@tschettervictor
Copy link
Collaborator

Seems to work, along with setting properties that include values.

@tschettervictor
Copy link
Collaborator

@yaazkal @bmac2 Can you also test?

@bmac2
Copy link
Collaborator

bmac2 commented Jan 7, 2025

worked as advertised. Merging

@bmac2 bmac2 merged commit ee644d4 into BastilleBSD:master Jan 7, 2025
1 check passed
@louwe
Copy link

louwe commented Jan 9, 2025

Thanks for fixing this. May I inquire if this will make it into the next release and when we should expect the version to be released to LATEST package repos?

@bmac2
Copy link
Collaborator

bmac2 commented Jan 9, 2025

@louwe you can get it now installing from github. Hopefully we will have a new release out soon. Got a couple of more PRs to get done before next release.

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.

[BUG] CONFIG template hook is NOT idempotent.
4 participants