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