]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add access function attributes to grp and shadow headers
authorSteve Grubb <sgrubb@redhat.com>
Thu, 10 Mar 2022 22:31:34 +0000 (17:31 -0500)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 14 Mar 2022 14:32:30 +0000 (20:02 +0530)
This patch adds access function attributes to the re-entrant functions
in grp.h and shadow headers.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
grp/grp.h
gshadow/gshadow.h
shadow/shadow.h

index db32f897ec3bde761cc485240ccf4b6b5324e72d..bd3f6010ed19a3fc9408fd5ab762b15f04ebf638 100644 (file)
--- 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 */
index 66d6d3b883f3032686d349254cfeaa6008d02c87..170df5f68a54c07b40942cc9066ea0048889356f 100644 (file)
@@ -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
index b29bcc41d0fcf88f424c0d92aeee245a9832eeb4..649691b63c070994c3be57cfbe303abc8f8a93af 100644 (file)
@@ -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 */