]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-double_check_unpackaged_subdirs.patch
- added rpm-double_check_unpackaged_subdirs patch (do a strict check when Bloom filte...
[packages/rpm.git] / rpm-double_check_unpackaged_subdirs.patch
CommitLineData
3a3e476f
JB
1Let packagedDir do a strict check when Bloom filter returns true.
2Also, don't try to check dirs over buildroot to avoid wasting time
3for useless checks (note that before packagedDir() could succeed on
4some dir over buildroot, leading to log some junk, after the end of
5string shorter than buildrootL).
6
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 @@
10 }
11
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 @*/
18 {
19- return rpmbfChk(rpmfiFNBF(pkg->fi), d, strlen(d));
20+ if(!rpmbfChk(rpmfiFNBF(pkg->fi), d, strlen(d)))
21+ return 0;
22+ char * fifn = (char *) xmalloc(pkg->fi->fnlen + 1);
23+ rpmuint32_t j;
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)) {
29+ free(fifn);
30+ return 1;
31+ }
32+ }
33+ free(fifn);
34+ return 0;
35 }
36
37 /* auxiliary function: find unpackaged subdirectories
38@@ -3076,6 +3090,8 @@
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 */
44 *p = '\0';
45 found = packagedDir(pkg, fn);
46 *p = '/';
This page took 0.094509 seconds and 4 git commands to generate.