Page MenuHomeFreeBSD

Add PF_IMMUTABLE for immutable parameters in jail.conf
ClosedPublic

Authored by hrs on Jul 7 2015, 6:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 6:06 AM
Unknown Object (File)
Fri, Apr 26, 6:06 AM
Unknown Object (File)
Feb 3 2024, 3:35 PM
Unknown Object (File)
Dec 31 2023, 10:33 PM
Unknown Object (File)
Dec 20 2023, 1:09 AM
Unknown Object (File)
Dec 11 2023, 1:04 PM
Unknown Object (File)
Dec 2 2023, 8:23 PM
Unknown Object (File)
Oct 20 2023, 3:00 PM
Subscribers

Details

Summary

Currently "name" parameter can be redefined as a normal variable
in jail.conf. However, redefinition of it causes a mismatch
between j->intparams[KP_NAME] and j->name, and screws up parameter
configurations. This has been reported in PR 196574.

This patch makes "name" as an immutable parameter. This prevents both

foo { $name = "bar"; }

in jail.conf and a command line like "jail -c name=j1 name=j2".

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

hrs retitled this revision from to Add PF_IMMUTABLE for immutable parameters in jail.conf.
hrs updated this object.
hrs edited the test plan for this revision. (Show Details)
hrs added a reviewer: jamie.

You may want to do the same with jid. You can give the jail.conf block a numeric tag, which will set the jid instead of the name, but will will still set j->name to that tag string. I would expect the same sort of problem from then setting jid=x inside the block.

hrs edited edge metadata.

Add PF_IMMUTABLE flag to both jid and name

In D3017#59419, @jamie wrote:

You may want to do the same with jid. You can give the jail.conf block a numeric tag, which will set the jid instead of the name, but will will still set j->name to that tag string. I would expect the same sort of problem from then setting jid=x inside the block.

That's true. Thank you for your comment. The updated patch adds immutable flag to jid, too. Can you accept this revision if it is ready to commit?

jamie edited edge metadata.
This revision is now accepted and ready to land.Jul 8 2015, 3:43 AM
This revision was automatically updated to reflect the committed changes.