util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Karel Zak <kzak@redhat.com>
Cc: mtk.manpages@gmail.com, util-linux@vger.kernel.org,
	Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH] ipcs.1: ipcs no longer needs read permission on IPC resources
Date: Sat, 16 May 2020 10:10:27 +0200	[thread overview]
Message-ID: <5700d4b6-c499-0881-263c-7df96df511ff@gmail.com> (raw)

From: Michael Kerrisk <mtk.manpages@gmail.com>
Date: Sat, 16 May 2020 09:45:11 +0200
Subject: [PATCH] ipcs.1: ipcs no longer needs read permission on IPC resources

With changes starting around util-linux commit 058e81540fbb0d2b78
that switched from using IPC_STAT to parsing /proc/sysvipc/*,
ipcs now shows all IPC objects rather than just the objects for
which the user has read permission. Update the page to reflect this
fact, and also add a NOTES section describing the historical and
fallback behavior where /proc is not available.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
---
 sys-utils/ipcs.1 | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/sys-utils/ipcs.1 b/sys-utils/ipcs.1
index 93c35e323..4b3baaaa5 100644
--- a/sys-utils/ipcs.1
+++ b/sys-utils/ipcs.1
@@ -8,8 +8,7 @@ ipcs \- show information on IPC facilities
 [options]
 .SH DESCRIPTION
 .B ipcs
-shows information on the inter-process communication facilities
-for which the calling process has read access.
+shows information on inter-process communication facilities.
 By default it shows information about all three resources:
 shared memory segments, message queues, and semaphore arrays.
 .SH OPTIONS
@@ -76,6 +75,25 @@ Print sizes in bytes.
 .TP
 .B \-\-human
 Print sizes in human-readable format.
+.SH NOTES
+The current implementation of
+.B ipcs
+obtains information about available IPC resources by parsing the files in
+.IR /proc/sysvipc .
+Before util-linux version v2.23, an alternate mechanism was used: the
+.BR IPC_STAT
+command of
+.BR msgctl (2),
+.BR semctl (2),
+and
+.BR shmctl (2).
+This mechanism is also used in later util-linux versions in the case where
+.I /proc
+is unavailable.
+A limitation of the
+.B IPC_STAT
+mechanism is that it can only be used to retrieve information about
+IPC resources for which the user has read permission.
 .SH SEE ALSO
 .BR ipcmk (1),
 .BR ipcrm (1),
-- 
2.26.2

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

             reply	other threads:[~2020-05-16  8:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-16  8:10 Michael Kerrisk (man-pages) [this message]
2020-05-18 11:41 ` [PATCH] ipcs.1: ipcs no longer needs read permission on IPC resources Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5700d4b6-c499-0881-263c-7df96df511ff@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=kerolasa@iki.fi \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).