Page MenuHomeFreeBSD

Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8), sockstat(1), ugidfw(8)
ClosedPublic

Authored by jamie on Jun 28 2018, 4:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 22, 9:56 PM
Unknown Object (File)
Thu, Sep 25, 6:15 PM
Unknown Object (File)
Thu, Sep 25, 5:06 AM
Unknown Object (File)
Sep 17 2025, 3:01 PM
Unknown Object (File)
Sep 16 2025, 4:51 AM
Unknown Object (File)
Sep 14 2025, 7:23 PM
Unknown Object (File)
Sep 11 2025, 11:26 PM
Unknown Object (File)
Sep 10 2025, 9:31 AM

Details

Summary

Most system utilities that work with jails allow the jail to be specified by name or ID, but a few are still ID-only. Use jail_getid(3) to fix the laggards.

Diff Detail

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

Event Timeline

I had a memory of some utilities supporting any or -1 for "in a jail" (i.e. jid != 0). Might be worth looking at doing this too

lib/libugidfw/ugidfw.c
615 ↗(On Diff #44578)

I'm not a fan of this, though I understand its a copy

This revision is now accepted and ready to land.Jun 28 2018, 7:23 PM
sbin/ipfw/ipfw.8
1540 ↗(On Diff #44578)

suggestion: rephrase prison to jail, and use whose (change prison in surrounding lines, too)

lib/libugidfw/ugidfw.c
615 ↗(On Diff #44578)

Yes, it's kind of ugly (same ugliness in libjail). But it's a limitation of struct iovec, which is geared toward bi-directional traffic even though the parameter names are always read-only. I didn't want to make a new data type, or to copy every name that gets passed to jail_get(2) or jail_set(2).

sbin/ipfw/ipfw.8
1540 ↗(On Diff #44578)

Sounds good - "prison" is now "jail". Except I went with "jail whose ID or name is" instead of "jail whose jail ID or name is"