Bug 257556 - POSIX shared memory: Allow listing shared memory segments by jail
Summary: POSIX shared memory: Allow listing shared memory segments by jail
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Jamie Gritton
URL:
Keywords:
Depends on: 257554
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-02 10:08 UTC by Michael Gmelin
Modified: 2022-03-02 23:14 UTC (History)
2 users (show)

See Also:


Attachments
Add -j option to "posixshmcontrol ls" (3.54 KB, patch)
2022-02-25 01:25 UTC, Jamie Gritton
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gmelin freebsd_committer freebsd_triage 2021-08-02 10:08:45 UTC
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
Comment 1 Jamie Gritton freebsd_committer freebsd_triage 2022-02-25 01:25:38 UTC
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.
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-02-27 01:47:23 UTC
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(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-03-02 23:13:28 UTC
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(-)