public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] Add access function attributes to grp and shadow headers
@ 2022-03-14 15:19 Siddhesh Poyarekar
0 siblings, 0 replies; only message in thread
From: Siddhesh Poyarekar @ 2022-03-14 15:19 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a35b8b225da4d3cf4bd81af3808f2ec50db003ce
commit a35b8b225da4d3cf4bd81af3808f2ec50db003ce
Author: Steve Grubb <sgrubb@redhat.com>
Date: Thu Mar 10 17:31:34 2022 -0500
Add access function attributes to grp and shadow headers
This patch adds access function attributes to the re-entrant functions
in grp.h and shadow headers.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diff:
---
grp/grp.h | 12 ++++++++----
gshadow/gshadow.h | 12 ++++++++----
shadow/shadow.h | 12 ++++++++----
3 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/grp/grp.h b/grp/grp.h
index db32f897ec..bd3f6010ed 100644
--- a/grp/grp.h
+++ b/grp/grp.h
@@ -130,7 +130,8 @@ extern struct group *getgrnam (const char *__name);
# ifdef __USE_GNU
extern int getgrent_r (struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result);
+ struct group **__restrict __result)
+ __attr_access ((__write_only__, 2, 3));
# endif
/* Search for an entry with a matching group ID.
@@ -139,7 +140,8 @@ extern int getgrent_r (struct group *__restrict __resultbuf,
marked with __THROW. */
extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result);
+ struct group **__restrict __result)
+ __attr_access ((__write_only__, 3, 4));
/* Search for an entry with a matching group name.
@@ -148,7 +150,8 @@ extern int getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
extern int getgrnam_r (const char *__restrict __name,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result);
+ struct group **__restrict __result)
+ __attr_access ((__write_only__, 3, 4));
# ifdef __USE_MISC
/* Read a group entry from STREAM. This function is not standardized
@@ -161,7 +164,8 @@ extern int getgrnam_r (const char *__restrict __name,
extern int fgetgrent_r (FILE *__restrict __stream,
struct group *__restrict __resultbuf,
char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result);
+ struct group **__restrict __result)
+ __attr_access ((__write_only__, 3, 4));
# endif
#endif /* POSIX or reentrant */
diff --git a/gshadow/gshadow.h b/gshadow/gshadow.h
index 66d6d3b883..170df5f68a 100644
--- a/gshadow/gshadow.h
+++ b/gshadow/gshadow.h
@@ -108,19 +108,23 @@ extern int putsgent (const struct sgrp *__g, FILE *__stream);
or due to the implementation they are cancellation points and
therefore not marked with __THROW. */
extern int getsgent_r (struct sgrp *__result_buf, char *__buffer,
- size_t __buflen, struct sgrp **__result);
+ size_t __buflen, struct sgrp **__result)
+ __attr_access ((__write_only__, 2, 3));
extern int getsgnam_r (const char *__name, struct sgrp *__result_buf,
char *__buffer, size_t __buflen,
- struct sgrp **__result);
+ struct sgrp **__result)
+ __attr_access ((__write_only__, 3, 4));
extern int sgetsgent_r (const char *__string, struct sgrp *__result_buf,
char *__buffer, size_t __buflen,
- struct sgrp **__result);
+ struct sgrp **__result)
+ __attr_access ((__write_only__, 3, 4));
extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf,
char *__buffer, size_t __buflen,
- struct sgrp **__result);
+ struct sgrp **__result)
+ __attr_access ((__write_only__, 3, 4));
#endif /* misc */
__END_DECLS
diff --git a/shadow/shadow.h b/shadow/shadow.h
index b29bcc41d0..649691b63c 100644
--- a/shadow/shadow.h
+++ b/shadow/shadow.h
@@ -122,19 +122,23 @@ extern int putspent (const struct spwd *__p, FILE *__stream);
or due to the implementation they are cancellation points and
therefore not marked with __THROW. */
extern int getspent_r (struct spwd *__result_buf, char *__buffer,
- size_t __buflen, struct spwd **__result);
+ size_t __buflen, struct spwd **__result)
+ __attr_access ((__write_only__, 2, 3));
extern int getspnam_r (const char *__name, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
- struct spwd **__result);
+ struct spwd **__result)
+ __attr_access ((__write_only__, 3, 4));
extern int sgetspent_r (const char *__string, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
- struct spwd **__result);
+ struct spwd **__result)
+ __attr_access ((__write_only__, 3, 4));
extern int fgetspent_r (FILE *__stream, struct spwd *__result_buf,
char *__buffer, size_t __buflen,
- struct spwd **__result);
+ struct spwd **__result)
+ __attr_access ((__write_only__, 3, 4));
#endif /* misc */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-14 15:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 15:19 [glibc] Add access function attributes to grp and shadow headers Siddhesh Poyarekar
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).