Summary: | some system utilities take JID only, not jail name | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Miroslav Lachman <000.fbsd> | ||||
Component: | bin | Assignee: | Jamie Gritton <jamie> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Many People | CC: | chris, eadler, jamie, me, portmaster | ||||
Priority: | --- | Keywords: | patch | ||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
URL: | https://lists.freebsd.org/pipermail/freebsd-jail/2018-June/003588.html | ||||||
Attachments: |
|
Description
Miroslav Lachman
2018-06-24 08:02:08 UTC
I found four programs that let you specify a jail by JID only: cpuset(1) ipfw(8) sockstat(1) ugidfw(8) Eight programs (11 if you count the jail programs themselves) that allow jails to be specified by name or ID: ifconfig(8) ifconfig(8) pkill(1) ps(1) service(8) sysrc(8) xtop(1) zfs(8) And one that only allows jail by name: rctl(8) Of the four that only take a JID, a fix is easy for cpuset, ipfw, and sockstat. ugidfw(8) actually parses the JID in libugidfw(3), and I'm hesitant to introduce a library dependency within another library; I may end up basically re-coding jail_getid(3) there. A "fix" for rctl(8) to take JIDs is out of scope: the name parsing for that one is actually done in the kernel. Created attachment 194658 [details]
Uses jail_getid(3) or equivalent for: cpuset, ipfw, libugidfw, sockstat
May I suggest to put this on reviews.freebsd.org ? OK, I've added it as differential D16047. A commit references this bug: Author: jamie Date: Tue Jul 3 23:47:23 UTC 2018 New revision: 335921 URL: https://svnweb.freebsd.org/changeset/base/335921 Log: Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8), sockstat(1), ugidfw(8) These are the last of the jail-aware userland utilities that didn't work with names. PR: 229266 MFC after: 3 days Differential Revision: D16047 Changes: head/lib/libugidfw/ugidfw.c head/sbin/ipfw/Makefile head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/usr.bin/cpuset/Makefile head/usr.bin/cpuset/cpuset.1 head/usr.bin/cpuset/cpuset.c head/usr.bin/sockstat/Makefile head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c A commit references this bug: Author: jamie Date: Fri Jul 6 16:23:30 UTC 2018 New revision: 336035 URL: https://svnweb.freebsd.org/changeset/base/336035 Log: Missed a bit of doc change from r335921. PR: 229266 Changes: head/usr.bin/cpuset/cpuset.1 A commit references this bug: Author: jamie Date: Fri Jul 6 19:10:09 UTC 2018 New revision: 336039 URL: https://svnweb.freebsd.org/changeset/base/336039 Log: MFC r335921: Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8), sockstat(1), ugidfw(8) These are the last of the jail-aware userland utilities that didn't work with names. PR: 229266 Differential Revision: D16047 Changes: _U stable/10/ stable/10/lib/libugidfw/ugidfw.c stable/10/sbin/ipfw/Makefile stable/10/sbin/ipfw/ipfw.8 stable/10/sbin/ipfw/ipfw2.c stable/10/usr.bin/cpuset/Makefile stable/10/usr.bin/cpuset/cpuset.1 stable/10/usr.bin/cpuset/cpuset.c stable/10/usr.bin/sockstat/Makefile stable/10/usr.bin/sockstat/sockstat.1 stable/10/usr.bin/sockstat/sockstat.c A commit references this bug: Author: jamie Date: Fri Jul 6 19:10:13 UTC 2018 New revision: 336040 URL: https://svnweb.freebsd.org/changeset/base/336040 Log: MFC r335921: Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8), sockstat(1), ugidfw(8) These are the last of the jail-aware userland utilities that didn't work with names. PR: 229266 Differential Revision: D16047 Changes: _U stable/11/ stable/11/lib/libugidfw/ugidfw.c stable/11/sbin/ipfw/Makefile stable/11/sbin/ipfw/ipfw.8 stable/11/sbin/ipfw/ipfw2.c stable/11/usr.bin/cpuset/Makefile stable/11/usr.bin/cpuset/cpuset.1 stable/11/usr.bin/cpuset/cpuset.c stable/11/usr.bin/sockstat/Makefile stable/11/usr.bin/sockstat/sockstat.1 stable/11/usr.bin/sockstat/sockstat.c |