Linux-man Archive on lore.kernel.org
 help / color / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: kevin dankwardt <kevin.dankwardt@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org
Subject: Re: [patch] Add note about there is no default permission mode in umask man page
Date: Fri, 24 Jul 2020 13:36:59 +0200
Message-ID: <31626a3a-6d3e-c8fa-af98-b98b356fcdcf@gmail.com> (raw)
In-Reply-To: <CAJUC52H2YPD2B7Nh-eDO-QzbwuyYiNokYAWYQU1z0hWRpJ3y8A@mail.gmail.com>

Hi Kevin!

On 7/23/20 8:39 PM, kevin dankwardt wrote:
> man pages version 5.08
> 
>>From 884004f93893cb01002d886387c78ba58d1aff53 Mon Sep 17 00:00:00 2001
> From: Kevin Dankwardt <kevin.dankwardt@gmail.com>
> Date: Thu, 23 Jul 2020 11:31:55 -0700
> Subject: [PATCH] Add note about there is no default permission mode
> 
> ---
>  man2/umask.2 | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/man2/umask.2 b/man2/umask.2
> index e74e8ef..6bc8ba1 100644
> --- a/man2/umask.2
> +++ b/man2/umask.2
> @@ -138,6 +138,8 @@ Inspecting this field in
>  .IR /proc/self/status
>  allows a process to retrieve its umask without at the same time changing
> it.
>  .PP
> +The Linux kernel has no default permission modes for created files or
> directories and thus the permission modes are non-deterministic for a file
> or directory created with no requested permission modes.
> +.PP
>  The umask setting also affects the permissions assigned to POSIX IPC
> objects
>  .RB ( mq_open (3),
>  .BR sem_open (3),

The umask(2) page seems the wrong place for a note such as this,
since this doesn't really relate to the umask. I assume that what
you really care about here is a call to open(2) that wrongly 
omits mode:

fd = open(path, O_CREAT | O_RDWR);

The open(2) manual page already warns against that, but I have 
reworded the text in that page a little to further emphasize the
point.

Cheers,

Michael


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

           reply index

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAJUC52H2YPD2B7Nh-eDO-QzbwuyYiNokYAWYQU1z0hWRpJ3y8A@mail.gmail.com>]

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=31626a3a-6d3e-c8fa-af98-b98b356fcdcf@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=kevin.dankwardt@gmail.com \
    --cc=linux-man@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

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git