When listing POSIX shared memory segments using posixshmcontrol, it would be nice to be able to limit the output based on jail id and/or jail name, e.g. posixshmcontrol -j shmtest ls This could be made work based on the jail's path, as this already controls access to shared memory segments (and should also work subjails/jail hierarchies - hence the dependency on bug #257554). See also this discussion: https://lists.freebsd.org/archives/freebsd-jail/2021-June/000029.html
Created attachment 232092 [details] Add -j option to "posixshmcontrol ls" This adds "posixshmcontrol ls -j foo". It's not quite the "posixshmcontrol -j foo ls" that you suggested, because I'm not using the option for the other commands. It could be done, and I suppose it would prepend the jail's path to the one given on the command line, but I'm not sure that would be either intuitive or particularly useful.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=be7cf3f4b8c2818155f5a4a83c64c9ef6a60a320 commit be7cf3f4b8c2818155f5a4a83c64c9ef6a60a320 Author: Jamie Gritton <jamie@FreeBSD.org> AuthorDate: 2022-02-27 01:45:28 +0000 Commit: Jamie Gritton <jamie@FreeBSD.org> CommitDate: 2022-02-27 01:45:28 +0000 posixshm: Add a -j option to posixshmcontrol ls, to specify a jail PR: 257556 Reported by: grembo@ usr.bin/posixshmcontrol/Makefile | 2 +- usr.bin/posixshmcontrol/posixshmcontrol.1 | 8 ++++++- usr.bin/posixshmcontrol/posixshmcontrol.c | 39 ++++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 8 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1e40fc6fa9c4e394195fd2972c8831526c684f5e commit 1e40fc6fa9c4e394195fd2972c8831526c684f5e Author: Jamie Gritton <jamie@FreeBSD.org> AuthorDate: 2022-02-27 01:45:28 +0000 Commit: Jamie Gritton <jamie@FreeBSD.org> CommitDate: 2022-03-02 23:10:33 +0000 MFC posixshm: Add a -j option to posixshmcontrol ls, to specify a jail PR: 257556 Reported by: grembo@ (cherry picked from commit be7cf3f4b8c2818155f5a4a83c64c9ef6a60a320) usr.bin/posixshmcontrol/Makefile | 2 +- usr.bin/posixshmcontrol/posixshmcontrol.1 | 8 ++++++- usr.bin/posixshmcontrol/posixshmcontrol.c | 39 ++++++++++++++++++++++++++----- 3 files changed, 41 insertions(+), 8 deletions(-)