From: kloczek Date: Wed, 21 Nov 2001 13:28:54 +0000 (+0000) Subject: - use getpwuid_r instead of getpwuid (patch from rawhide). X-Git-Tag: cracklib-2_7-14~1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fcracklib.git;a=commitdiff_plain;h=37b3c776df46255587e15a4e17d878a58ce43a01 - use getpwuid_r instead of getpwuid (patch from rawhide). Changed files: cracklib-nss.patch -> 1.1 --- diff --git a/cracklib-nss.patch b/cracklib-nss.patch new file mode 100644 index 0000000..30f90b8 --- /dev/null +++ b/cracklib-nss.patch @@ -0,0 +1,49 @@ +--- cracklib,2.7/cracklib/fascist.c Tue Oct 2 15:58:43 2001 ++++ cracklib,2.7/cracklib/fascist.c Tue Oct 2 16:06:44 2001 +@@ -10,6 +10,8 @@ + + #include "packer.h" + #include ++#include ++#include + #include + #include + #include +@@ -488,13 +490,35 @@ + int wc; + char *ptr; + int gwords; +- struct passwd *pwp; ++ struct passwd *pwp, passwd; + char gbuffer[STRINGSIZE]; + char tbuffer[STRINGSIZE]; ++ char *sbuffer; ++ size_t sbufferlen; + char *uwords[STRINGSIZE]; + char longbuffer[STRINGSIZE * 2]; + +- if (!(pwp = getpwuid(uid))) ++ sbuffer = malloc(sbufferlen = LINE_MAX); ++ if (sbuffer == NULL) ++ { ++ return ("memory allocation error"); ++ } ++ while ((i = getpwuid_r(uid, &passwd, sbuffer, sbufferlen, &pwp)) != 0) ++ { ++ if (i == ERANGE) ++ { ++ free(sbuffer); ++ sbuffer = malloc(sbufferlen += LINE_MAX); ++ if (sbuffer == NULL) ++ { ++ return ("memory allocation error"); ++ } ++ } else { ++ pwp = NULL; ++ break; ++ } ++ } ++ if (pwp == NULL) + { + return ("you are not registered in the password file"); + }