From: Benno Schulenberg <bensberg@telfort.nl>
To: util-linux@vger.kernel.org
Subject: [PATCH 07/14] unshare: don't mark "|" and ":" as part of the placeholders
Date: Sun, 9 Feb 2025 09:23:23 +0100 [thread overview]
Message-ID: <20250209082330.4235-7-bensberg@telfort.nl> (raw)
In-Reply-To: <20250209082330.4235-1-bensberg@telfort.nl>
The "|" is a meta-character, and should thus be left unmarked, while
the ":" (in the argument of --map-users/--map-groups) is a literal,
and should therefore be marked in bold.
Also, add the new 'subids' literal value for the above two options.
And in the bargain tweak a comment.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
sys-utils/unshare.1.adoc | 12 ++++++------
sys-utils/unshare.c | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sys-utils/unshare.1.adoc b/sys-utils/unshare.1.adoc
index c6973f938..2bcc193ff 100644
--- a/sys-utils/unshare.1.adoc
+++ b/sys-utils/unshare.1.adoc
@@ -93,21 +93,21 @@ Just before running the program, mount the proc filesystem at _mountpoint_ (defa
*--mount-binfmt*[**=**__mountpoint__]::
Just before running the program, mount the binfmt_misc filesystem at _mountpoint_ (default is /proc/sys/fs/binfmt_misc). It also implies creating a new mount namespace since the binfmt_misc mount would otherwise mess up existing programs on the system. The new binfmt_misc filesystem is explicitly mounted as private (with *MS_PRIVATE*|*MS_REC*).
-*--map-user* __uid|name__::
+*--map-user* __uid__|__name__::
Run the program only after the current effective user ID has been mapped to _uid_. If this option is specified multiple times, the last occurrence takes precedence. This option implies *--user*.
-*--map-users* __inneruid:outeruid:count__|**auto**|**all**::
+*--map-users* __inneruid__**:**__outeruid__**:**__count__|**auto**|**subids**|**all**::
Run the program only after the block of user IDs of size _count_ beginning at _outeruid_ has been mapped to the block of user IDs beginning at _inneruid_. This mapping is created with **newuidmap**(1) if *unshare* was run unprivileged. If the range of user IDs overlaps with the mapping specified by *--map-user*, then a "hole" will be removed from the mapping. This may result in the highest user ID of the mapping not being mapped. Use *--map-users* multiple times to map more than one block of user IDs. The special value *auto* will map the first block of user IDs owned by the effective user from _/etc/subuid_ to a block starting at user ID 0. The special value *subids* will identity map the same block. The special value *all* will create a pass-through map for every user ID available in the parent namespace. This option implies *--user*.
+
-Before util-linux version 2.39, this option expected a comma-separated argument of the form _outeruid,inneruid,count_ but that format is now deprecated for consistency with the ordering used in _/proc/[pid]/uid_map_ and the _X-mount.idmap_ mount option.
+Before util-linux version 2.39, this option expected a comma-separated argument of the form _outeruid_**,**_inneruid_**,**_count_ but that format is now deprecated for consistency with the ordering used in _/proc/[pid]/uid_map_ and the _X-mount.idmap_ mount option.
-*--map-group* __gid|name__::
+*--map-group* __gid__|__name__::
Run the program only after the current effective group ID has been mapped to _gid_. If this option is specified multiple times, the last occurrence takes precedence. This option implies *--setgroups=deny* and *--user*.
-*--map-groups* __innergid:outergid:count__|**auto**|**all**::
+*--map-groups* __innergid__**:**__outergid__**:**__count__|**auto**|**subids**|**all**::
Run the program only after the block of group IDs of size _count_ beginning at _outergid_ has been mapped to the block of group IDs beginning at _innergid_. This mapping is created with **newgidmap**(1) if *unshare* was run unprivileged. If the range of group IDs overlaps with the mapping specified by *--map-group*, then a "hole" will be removed from the mapping. This may result in the highest group ID of the mapping not being mapped. Use *--map-groups* multiple times to map more than one block of group IDs. The special value *auto* will map the first block of user IDs owned by the effective user from _/etc/subgid_ to a block starting at group ID 0. The special value *subids* will identity map the same block. The special value *all* will create a pass-through map for every group ID available in the parent namespace. This option implies *--user*.
+
-Before util-linux version 2.39, this option expected a comma-separated argument of the form _outergid,innergid,count_ but that format is now deprecated for consistency with the ordering used in _/proc/[pid]/gid_map_ and the _X-mount.idmap_ mount option.
+Before util-linux version 2.39, this option expected a comma-separated argument of the form _outergid_**,**_innergid_**,**_count_ but that format is now deprecated for consistency with the ordering used in _/proc/[pid]/gid_map_ and the _X-mount.idmap_ mount option.
*--map-auto*::
Map the first block of user IDs owned by the effective user from _/etc/subuid_ to a block starting at user ID 0. In the same manner, also map the first block of group IDs owned by the effective group from _/etc/subgid_ to a block starting at group ID 0. This option is intended to handle the common case where the first block of subordinate user and group IDs can map the whole user and group ID space. This option is equivalent to specifying *--map-users=auto* and *--map-groups=auto*.
diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
index 9b87acd67..4d078e4d5 100644
--- a/sys-utils/unshare.c
+++ b/sys-utils/unshare.c
@@ -413,7 +413,7 @@ static struct map_range get_map_range(const char *s)
* @filename: The file to look up the range from. This should be either
* ``/etc/subuid`` or ``/etc/subgid``.
* @uid: The uid of the user whose range we should look up.
- * @identity: (boolean) If true identity map the range, otherwise map to 0
+ * @identity: (boolean) If true, identity map the range, otherwise map to 0.
*
* This finds the first subid range matching @uid in @filename.
*/
--
2.48.1
next prev parent reply other threads:[~2025-02-09 8:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-09 8:23 [PATCH 01/14] setpriv: make message for failing PR_GET_PDEATHSIG the same as the other Benno Schulenberg
2025-02-09 8:23 ` [PATCH 02/14] unshare: don't use "=" before a required option argument Benno Schulenberg
2025-02-09 8:23 ` [PATCH 03/14] unshare: use single asterisks around long options, double around values Benno Schulenberg
2025-02-09 8:23 ` [PATCH 04/14] textual: remove other inconsistent uses of "=" before option argument Benno Schulenberg
2025-02-09 8:23 ` [PATCH 05/14] textual: consistently mark "=" as literal before an optional argument Benno Schulenberg
2025-02-09 8:23 ` [PATCH 06/14] mount: properly mark the arguments of the 'ro' and 'rw' extended options Benno Schulenberg
2025-02-09 8:23 ` Benno Schulenberg [this message]
2025-02-09 8:23 ` [PATCH 08/14] textual: give seven error messages the same form as two others Benno Schulenberg
2025-02-09 8:23 ` [PATCH 09/14] blkpr: grammarize the description of the tool and its options Benno Schulenberg
2025-02-09 8:23 ` [PATCH 10/14] blkzone: correct the wording of an error message, from ioctl to function Benno Schulenberg
2025-02-10 11:28 ` Karel Zak
2025-02-09 8:23 ` [PATCH 11/14] renice: put text that belongs together into a single translatable message Benno Schulenberg
2025-02-09 8:23 ` [PATCH 12/14] man pages: use the same verb for --version as for --help, like in usages Benno Schulenberg
2025-02-09 8:23 ` [PATCH 13/14] usage: mention also the missing KiB and MiB as permissible suffixes Benno Schulenberg
2025-02-09 8:23 ` [PATCH 14/14] zramctl: improve grammar in usage and don't gettextize list of algorithms Benno Schulenberg
2025-02-12 10:01 ` [PATCH 01/14] setpriv: make message for failing PR_GET_PDEATHSIG the same as the other 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=20250209082330.4235-7-bensberg@telfort.nl \
--to=bensberg@telfort.nl \
--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