1 Let packagedDir do a strict check when Bloom filter returns true.
2 Also, don't try to check dirs over buildroot to avoid wasting time
3 for useless checks (note that before packagedDir() could succeed on
4 some dir over buildroot, leading to log some junk, after the end of
5 string shorter than buildrootL).
7 --- rpm-5.4.13/build/files.c.orig 2013-10-04 21:31:18.840898688 +0200
8 +++ rpm-5.4.13/build/files.c 2013-10-13 09:09:23.406411763 +0200
9 @@ -3032,12 +3032,26 @@
12 /* auxiliary function: check if directory d is packaged */
13 -static inline int packagedDir(Package pkg, const char *d)
14 +static int packagedDir(Package pkg, const char *d)
15 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
16 /*@modifies pkg->header,
17 rpmGlobalMacroContext, fileSystem, internalState @*/
19 - return rpmbfChk(rpmfiFNBF(pkg->fi), d, strlen(d));
20 + if(!rpmbfChk(rpmfiFNBF(pkg->fi), d, strlen(d)))
22 + char * fifn = (char *) xmalloc(pkg->fi->fnlen + 1);
24 + for(j = 0; j < pkg->fi->fc; j++) {
25 + const char * dn = NULL;
26 + (void) urlPath(pkg->fi->dnl[pkg->fi->dil[j]], &dn);
27 + strcpy(stpcpy(fifn, dn), pkg->fi->bnl[j]);
28 + if (!strcmp(d, fifn)) {
37 /* auxiliary function: find unpackaged subdirectories
39 strcpy(fn, rpmfiFN(fi));
40 /* find the first path component that is packaged */
41 while ((p = strchr(p + 1, '/'))) {
42 + if (p - fn < buildrootL)
43 + continue; /* don't try to check components over buildroot */
45 found = packagedDir(pkg, fn);