opnsense-src/lib/libjail
Igor Ostapenko 30e6e008bc jail: Add meta and env parameters
Each one is an arbitrary string associated with a jail. It can be set
upon jail creation or added/modified later:

    > jail -cm ... meta="tag1=value1 tag2=value2" env="configuration"

The values are not inherited from the parent jail.

A parent jail can read both metadata parameters, while a child jail can
read only env via security.jail.env sysctl.

The maximum size of meta or env per jail is controlled by the
global security.jail.meta_maxbufsize sysctl. Decreasing it does not
alter the existing meta information.

Each metadata buffer can be handled as a set of key=value\n strings:

    > jail -cm ... meta="$(echo k1=v1; echo k2=v2)" env.1=one
    > jls meta.k2 env.1 meta.k1

While meta.k1= resets the value to an empty string, the meta.k1 without
the equal sign removes the given key.

Relnotes:	yes
Reviewed by:	jamie
Tested by:	dch
Sponsored by:   SkunkWerks GmbH
Differential Revision:	https://reviews.freebsd.org/D47668
2025-03-31 09:17:03 +00:00
..
jail.3 manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
jail.c jail: Add meta and env parameters 2025-03-31 09:17:03 +00:00
jail.h jail: Add meta and env parameters 2025-03-31 09:17:03 +00:00
jail_getid.c lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00