Linux Manual Pages development
 help / color / mirror / Atom feed
* [PATCH] man/man7/mount_namespaces.7: Fix an incorrect path in an example
@ 2025-02-16 18:59 Göran Uddeborg
  2025-02-16 20:03 ` Alejandro Colomar
  0 siblings, 1 reply; 3+ messages in thread
From: Göran Uddeborg @ 2025-02-16 18:59 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

In the example showing how locked mounts in a less privileged mount
namespace can not be split, first /etc/shadow is bind mounted, then an
attempt is done to unmount /mnt/dir, which gives an error complaining
that /etc/shadow is not mounted. The unmount should also refer to
/etc/shadow.

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
---
 man/man7/mount_namespaces.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/man7/mount_namespaces.7 b/man/man7/mount_namespaces.7
index a1645e9e2..0e1223f99 100644
--- a/man/man7/mount_namespaces.7
+++ b/man/man7/mount_namespaces.7
@@ -1128,7 +1128,7 @@ .SS Restrictions on mount namespaces
 .EX
 # \fBunshare \-\-user \-\-map\-root\-user \-\-mount \[rs]\fP
                \fBstrace \-o /tmp/log \[rs]\fP
-               \fBumount /mnt/dir\fP
+               \fBumount /etc/shadow\fP
 umount: /etc/shadow: not mounted.
 # \fBgrep \[aq]\[ha]umount\[aq] /tmp/log\fP
 umount2("/etc/shadow", 0)     = \-1 EINVAL (Invalid argument)
-- 
2.40.1

[-- Attachment #2: Type: application/pgp-signature, Size: 862 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] man/man7/mount_namespaces.7: Fix an incorrect path in an example
  2025-02-16 18:59 [PATCH] man/man7/mount_namespaces.7: Fix an incorrect path in an example Göran Uddeborg
@ 2025-02-16 20:03 ` Alejandro Colomar
  2025-02-16 21:49   ` Göran Uddeborg
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Colomar @ 2025-02-16 20:03 UTC (permalink / raw)
  To: Göran Uddeborg; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 2536 bytes --]

Hi Göran,

On Sun, Feb 16, 2025 at 07:59:50PM +0100, Göran Uddeborg wrote:
> In the example showing how locked mounts in a less privileged mount
> namespace can not be split, first /etc/shadow is bind mounted, then an
> attempt is done to unmount /mnt/dir, which gives an error complaining
> that /etc/shadow is not mounted. The unmount should also refer to
> /etc/shadow.
> 
> Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>

Thanks!  I've applied the patch.  I applied some tweaks to it.  As you
suggested, I added a tag for linking to the bugzilla entry.  I also
added a tag that shows the commit that introduced the bug.

<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=4b307134ee68cd0f3568a3d2d9c2119bd5a8adf6>

	commit 4b307134ee68cd0f3568a3d2d9c2119bd5a8adf6
	Author: Göran Uddeborg <goeran@uddeborg.se>
	Date:   Sun Feb 16 19:59:50 2025 +0100

	    man/man7/mount_namespaces.7: Fix an incorrect path in an example
	    
	    In the example showing how locked mounts in a less privileged mount
	    namespace can not be split, first </etc/shadow> is bind mounted, then an
	    attempt is done to unmount </mnt/dir>, which gives an error complaining
	    that </etc/shadow> is not mounted.  The unmount should also refer to
	    </etc/shadow>.
	    
	    Fixes: 906ab4945cd3 (2021-08-20; "mount_namespaces.7: Rewrite locked mounts examples to use/etc/shadow")
	    Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=217709>
	    Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
	    Cc: Rajesh <r.pandian@gmail.com>
	    Message-ID: <26546.13734.573762.288144@gargle.gargle.HOWL>
	    Signed-off-by: Alejandro Colomar <alx@kernel.org>


Have a lovely night!
Alex

> ---
>  man/man7/mount_namespaces.7 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man/man7/mount_namespaces.7 b/man/man7/mount_namespaces.7
> index a1645e9e2..0e1223f99 100644
> --- a/man/man7/mount_namespaces.7
> +++ b/man/man7/mount_namespaces.7
> @@ -1128,7 +1128,7 @@ .SS Restrictions on mount namespaces
>  .EX
>  # \fBunshare \-\-user \-\-map\-root\-user \-\-mount \[rs]\fP
>                 \fBstrace \-o /tmp/log \[rs]\fP
> -               \fBumount /mnt/dir\fP
> +               \fBumount /etc/shadow\fP
>  umount: /etc/shadow: not mounted.
>  # \fBgrep \[aq]\[ha]umount\[aq] /tmp/log\fP
>  umount2("/etc/shadow", 0)     = \-1 EINVAL (Invalid argument)
> -- 
> 2.40.1

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] man/man7/mount_namespaces.7: Fix an incorrect path in an example
  2025-02-16 20:03 ` Alejandro Colomar
@ 2025-02-16 21:49   ` Göran Uddeborg
  0 siblings, 0 replies; 3+ messages in thread
From: Göran Uddeborg @ 2025-02-16 21:49 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

Alejandro Colomar:
> Thanks!  I've applied the patch.  I applied some tweaks to it.  As you
> suggested, I added a tag for linking to the bugzilla entry.  I also
> added a tag that shows the commit that introduced the bug.

Great, thanks!

[-- Attachment #2: Type: application/pgp-signature, Size: 862 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-16 21:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-16 18:59 [PATCH] man/man7/mount_namespaces.7: Fix an incorrect path in an example Göran Uddeborg
2025-02-16 20:03 ` Alejandro Colomar
2025-02-16 21:49   ` Göran Uddeborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox