public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] correct readlinkat attribute access (BZ #27024)
@ 2021-01-08  0:49 Martin Sebor
  2021-01-08  4:31 ` Siddhesh Poyarekar
  2021-01-10 20:52 ` Martin Sebor
  0 siblings, 2 replies; 5+ messages in thread
From: Martin Sebor @ 2021-01-08  0:49 UTC (permalink / raw)
  To: GNU C Library

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.  */

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

end of thread, other threads:[~2021-01-10 20:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08  0:49 [PATCH] correct readlinkat attribute access (BZ #27024) 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 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).