summaryrefslogtreecommitdiff
path: root/src/passwd/putgrent.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-05-16 17:12:56 -0400
committerRich Felker <dalias@aerifal.cx>2019-05-16 17:19:03 -0400
commit9fd98a6354105dd67b648b48dba238f4c3e3d564 (patch)
tree80dc8a692de9cfef36f68669606e3faa65cd46b3 /src/passwd/putgrent.c
parentf450c150d31730b18a145cca17150427cf3f20e6 (diff)
downloadmusl-9fd98a6354105dd67b648b48dba238f4c3e3d564.tar.gz
fix format strings for uid/gid values in putpwent/putgrent
commit 648c3b4e18b2ce2b6af7d44783e42ca267ea49f5 omitted this change, which is needed to be able to use uid/gid values greater than INT_MAX with these interfaces. it fixes alpine linux bug #10460.
Diffstat (limited to 'src/passwd/putgrent.c')
-rw-r--r--src/passwd/putgrent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passwd/putgrent.c b/src/passwd/putgrent.c
index a0b320fc..2a8257dc 100644
--- a/src/passwd/putgrent.c
+++ b/src/passwd/putgrent.c
@@ -7,7 +7,7 @@ int putgrent(const struct group *gr, FILE *f)
int r;
size_t i;
flockfile(f);
- if ((r = fprintf(f, "%s:%s:%d:", gr->gr_name, gr->gr_passwd, gr->gr_gid))<0) goto done;
+ if ((r = fprintf(f, "%s:%s:%u:", gr->gr_name, gr->gr_passwd, gr->gr_gid))<0) goto done;
if (gr->gr_mem) for (i=0; gr->gr_mem[i]; i++)
if ((r = fprintf(f, "%s%s", i?",":"", gr->gr_mem[i]))<0) goto done;
r = fputc('\n', f);