public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] correct readlinkat attribute access (BZ #27024)
Date: Sun, 10 Jan 2021 13:52:22 -0700	[thread overview]
Message-ID: <4e3b1dce-ed69-ada4-3e97-16560c4886d2@gmail.com> (raw)
In-Reply-To: <b39497cd-12ae-981c-73d4-22e99d57ba77@gmail.com>

I committed & pushed this in g:2cd361b511.

Martin

On 1/7/21 5:49 PM, Martin Sebor wrote:
> The mode in the new attribute access added in g:06febd8c670
> to readlinkat() for the third argument is wrong: it's read_only
> but the function writes into the object.  The mode should be
> write_only.
> 
> The trivial patch below corrects this mistake.  Unless there
> are objections I'll go ahead and commit it in the next few days.
> 
> Martin
> 
> diff --git a/posix/unistd.h b/posix/unistd.h
> index 1306aded46..3f22763379 100644
> --- a/posix/unistd.h
> +++ b/posix/unistd.h
> @@ -831,7 +831,7 @@ extern int symlinkat (const char *__from, int __tofd,
>   /* Like readlink but a relative PATH is interpreted relative to FD.  */
>   extern ssize_t readlinkat (int __fd, const char *__restrict __path,
>                             char *__restrict __buf, size_t __len)
> -     __THROW __nonnull ((2, 3)) __wur __attr_access ((__read_only__, 3, 
> 4));
> +     __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 
> 3, 4));
>   #endif
> 
>   /* Remove the link NAME.  */


      parent reply	other threads:[~2021-01-10 20:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  0:49 Martin Sebor
2021-01-08  4:31 ` Siddhesh Poyarekar
2021-01-08  9:06   ` Samuel Thibault
2021-01-08  9:08     ` Siddhesh Poyarekar
2021-01-10 20:52 ` Martin Sebor [this message]

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=4e3b1dce-ed69-ada4-3e97-16560c4886d2@gmail.com \
    --to=msebor@gmail.com \
    --cc=libc-alpha@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).