summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/cracklib
diff options
context:
space:
mode:
authorLei Maohui <leimaohui@cn.fujitsu.com>2015-06-09 10:27:55 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-11 23:59:17 +0100
commitf08baeed2cf480dfbd186493bfeaace193256ba7 (patch)
tree7870d909f45683c096df3da185d852adf9acd769 /meta/recipes-extended/cracklib
parent8db97b59914a38f4550b47fa4374a2d4312aec06 (diff)
downloadpoky-f08baeed2cf480dfbd186493bfeaace193256ba7.tar.gz
cracklib:Fix an error in the patch
To fix an error in the patch.Otherwise,the dictionary would be wrong. (From OE-Core rev: 8670b99b06ce14ed391b4713d7887af90d44a2c8) Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/cracklib')
-rw-r--r--meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch67
1 files changed, 37 insertions, 30 deletions
diff --git a/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
index 8e0f40642a..adbe7dfff4 100644
--- a/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
+++ b/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
@@ -1,7 +1,7 @@
1From dae29a98c066bc67bb5ba12219d5fd68a8675514 Mon Sep 17 00:00:00 2001 1From 8a6e43726ad0ae41bd1cc2c248d91deb31459357 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Lei Maohui <leimaohui@cn.fujitsu.com>
3Date: Fri, 26 Apr 2013 20:44:10 +0800 3Date: Tue, 9 Jun 2015 11:11:48 +0900
4Subject: [PATCH] packlib.c: support dictionary byte-order dependent 4Subject: [PATCH] packlib.c: support dictionary byte order dependent
5 5
6The previous dict files are NOT byte-order independent, in fact they are 6The previous dict files are NOT byte-order independent, in fact they are
7probably ARCHITECTURE SPECIFIC. 7probably ARCHITECTURE SPECIFIC.
@@ -12,7 +12,7 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
12Upstream-Status: Pending 12Upstream-Status: Pending
13 13
14We can't use the endian.h, htobe* and be*toh functions because they are 14We can't use the endian.h, htobe* and be*toh functions because they are
15not available on older versions of glibc, such as that found in RHEL 15not available on older versions of glibc, such as that found in RHEL
165.9. 165.9.
17 17
18Change to checking endian and directly calling bswap_* as defined in 18Change to checking endian and directly calling bswap_* as defined in
@@ -20,14 +20,15 @@ byteswap.h.
20 20
21Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 21Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
22 22
23Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
23--- 24---
24 lib/packlib.c | 208 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 25 lib/packlib.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
25 1 file changed, 204 insertions(+), 4 deletions(-) 26 1 file changed, 210 insertions(+), 4 deletions(-)
26 27
27Index: cracklib-2.8.22/lib/packlib.c 28diff --git a/lib/packlib.c b/lib/packlib.c
28=================================================================== 29index f851424..3aac805 100644
29--- cracklib-2.8.22.orig/lib/packlib.c 30--- a/lib/packlib.c
30+++ cracklib-2.8.22/lib/packlib.c 31+++ b/lib/packlib.c
31@@ -16,6 +16,12 @@ 32@@ -16,6 +16,12 @@
32 #ifdef HAVE_STDINT_H 33 #ifdef HAVE_STDINT_H
33 #include <stdint.h> 34 #include <stdint.h>
@@ -41,7 +42,7 @@ Index: cracklib-2.8.22/lib/packlib.c
41 #include "packer.h" 42 #include "packer.h"
42 43
43 static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993"; 44 static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993";
44@@ -45,6 +51,182 @@ typedef struct 45@@ -45,6 +51,185 @@ typedef struct
45 char data_get[NUMWORDS][MAXWORDLEN]; 46 char data_get[NUMWORDS][MAXWORDLEN];
46 } PWDICT64; 47 } PWDICT64;
47 48
@@ -145,7 +146,8 @@ Index: cracklib-2.8.22/lib/packlib.c
145+ 146+
146+ for (i = 0; i < nLen / sizeof(uint64_t); i++) 147+ for (i = 0; i < nLen / sizeof(uint64_t); i++)
147+ { 148+ {
148+ *pHwms64++ = bswap_64(*pHwms64); 149+ *pHwms64 = bswap_64(*pHwms64);
150+ *pHwms64++;
149+ } 151+ }
150+ 152+
151+ } 153+ }
@@ -155,7 +157,8 @@ Index: cracklib-2.8.22/lib/packlib.c
155+ 157+
156+ for (i = 0; i < nLen / sizeof(uint32_t); i++) 158+ for (i = 0; i < nLen / sizeof(uint32_t); i++)
157+ { 159+ {
158+ *pHwms32++ = bswap_32(*pHwms32); 160+ *pHwms32 = bswap_32(*pHwms32);
161+ *pHwms32++;
159+ } 162+ }
160+ 163+
161+ } 164+ }
@@ -199,7 +202,8 @@ Index: cracklib-2.8.22/lib/packlib.c
199+ 202+
200+ for (i = 0; i < nLen / sizeof(uint32_t); i++) 203+ for (i = 0; i < nLen / sizeof(uint32_t); i++)
201+ { 204+ {
202+ *pHwms32++ = bswap_32(*pHwms32); 205+ *pHwms32 = bswap_32(*pHwms32);
206+ *pHwms32++;
203+ } 207+ }
204+ 208+
205+ } 209+ }
@@ -224,7 +228,7 @@ Index: cracklib-2.8.22/lib/packlib.c
224 228
225 static int 229 static int
226 _PWIsBroken64(FILE *ifp) 230 _PWIsBroken64(FILE *ifp)
227@@ -57,6 +239,7 @@ _PWIsBroken64(FILE *ifp) 231@@ -57,6 +242,7 @@ _PWIsBroken64(FILE *ifp)
228 return 0; 232 return 0;
229 } 233 }
230 234
@@ -232,7 +236,7 @@ Index: cracklib-2.8.22/lib/packlib.c
232 return (pdesc64.header.pih_magic == PIH_MAGIC); 236 return (pdesc64.header.pih_magic == PIH_MAGIC);
233 } 237 }
234 238
235@@ -149,7 +332,11 @@ PWOpen(prefix, mode) 239@@ -149,7 +335,11 @@ PWOpen(prefix, mode)
236 pdesc.header.pih_blocklen = NUMWORDS; 240 pdesc.header.pih_blocklen = NUMWORDS;
237 pdesc.header.pih_numwords = 0; 241 pdesc.header.pih_numwords = 0;
238 242
@@ -245,23 +249,23 @@ Index: cracklib-2.8.22/lib/packlib.c
245 } else 249 } else
246 { 250 {
247 pdesc.flags &= ~PFOR_WRITE; 251 pdesc.flags &= ~PFOR_WRITE;
248@@ -173,6 +360,7 @@ PWOpen(prefix, mode) 252@@ -173,6 +363,7 @@ PWOpen(prefix, mode)
249 return ((PWDICT *) 0); 253 return NULL;
250 } 254 }
251 255
252+ IheaderBigEndianToHost((char *) &pdesc.header, en_is32); 256+ IheaderBigEndianToHost((char *) &pdesc.header, en_is32);
253 if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0)) 257 if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0))
254 { 258 {
255 /* uh-oh. either a broken "64-bit" file or a garbage file. */ 259 /* uh-oh. either a broken "64-bit" file or a garbage file. */
256@@ -195,6 +383,7 @@ PWOpen(prefix, mode) 260@@ -195,6 +386,7 @@ PWOpen(prefix, mode)
257 } 261 }
258 return ((PWDICT *) 0); 262 return NULL;
259 } 263 }
260+ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64); 264+ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
261 if (pdesc64.header.pih_magic != PIH_MAGIC) 265 if (pdesc64.header.pih_magic != PIH_MAGIC)
262 { 266 {
263 /* nope, not "64-bit" after all */ 267 /* nope, not "64-bit" after all */
264@@ -290,6 +479,7 @@ PWOpen(prefix, mode) 268@@ -290,6 +482,7 @@ PWOpen(prefix, mode)
265 { 269 {
266 pdesc.flags &= ~PFOR_USEHWMS; 270 pdesc.flags &= ~PFOR_USEHWMS;
267 } 271 }
@@ -269,7 +273,7 @@ Index: cracklib-2.8.22/lib/packlib.c
269 for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++) 273 for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++)
270 { 274 {
271 pdesc.hwms[i] = pdesc64.hwms[i]; 275 pdesc.hwms[i] = pdesc64.hwms[i];
272@@ -299,6 +489,7 @@ PWOpen(prefix, mode) 276@@ -299,6 +492,7 @@ PWOpen(prefix, mode)
273 { 277 {
274 pdesc.flags &= ~PFOR_USEHWMS; 278 pdesc.flags &= ~PFOR_USEHWMS;
275 } 279 }
@@ -277,7 +281,7 @@ Index: cracklib-2.8.22/lib/packlib.c
277 #if DEBUG 281 #if DEBUG
278 for (i=1; i<=0xff; i++) 282 for (i=1; i<=0xff; i++)
279 { 283 {
280@@ -332,7 +523,11 @@ PWClose(pwp) 284@@ -332,7 +526,11 @@ PWClose(pwp)
281 return (-1); 285 return (-1);
282 } 286 }
283 287
@@ -290,7 +294,7 @@ Index: cracklib-2.8.22/lib/packlib.c
290 { 294 {
291 fprintf(stderr, "index magic fwrite failed\n"); 295 fprintf(stderr, "index magic fwrite failed\n");
292 return (-1); 296 return (-1);
293@@ -351,7 +546,12 @@ PWClose(pwp) 297@@ -351,7 +549,12 @@ PWClose(pwp)
294 printf("hwm[%02x] = %d\n", i, pwp->hwms[i]); 298 printf("hwm[%02x] = %d\n", i, pwp->hwms[i]);
295 #endif 299 #endif
296 } 300 }
@@ -304,7 +308,7 @@ Index: cracklib-2.8.22/lib/packlib.c
304 } 308 }
305 } 309 }
306 310
307@@ -405,7 +605,8 @@ PutPW(pwp, string) 311@@ -405,7 +608,8 @@ PutPW(pwp, string)
308 312
309 datum = (uint32_t) ftell(pwp->dfp); 313 datum = (uint32_t) ftell(pwp->dfp);
310 314
@@ -314,19 +318,22 @@ Index: cracklib-2.8.22/lib/packlib.c
314 318
315 fputs(pwp->data_put[0], pwp->dfp); 319 fputs(pwp->data_put[0], pwp->dfp);
316 putc(0, pwp->dfp); 320 putc(0, pwp->dfp);
317@@ -473,6 +674,7 @@ GetPW(pwp, number) 321@@ -464,6 +668,7 @@ GetPW(pwp, number)
318 perror("(index fread failed)"); 322 perror("(index fread failed)");
319 return ((char *) 0); 323 return NULL;
320 } 324 }
321+ datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64; 325+ datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64;
322 datum = datum64; 326 datum = datum64;
323 } else { 327 } else {
324 if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0)) 328 if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0))
325@@ -486,6 +688,7 @@ GetPW(pwp, number) 329@@ -477,6 +682,7 @@ GetPW(pwp, number)
326 perror("(index fread failed)"); 330 perror("(index fread failed)");
327 return ((char *) 0); 331 return NULL;
328 } 332 }
329+ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum; 333+ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
330 } 334 }
331 335
332 int r = 1; 336 int r = 1;
337--
3381.8.4.2
339