Band-aid to dependency caching misbehaving with chrooted verify (RhBug:508074)
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 1 Jul 2009 10:59:53 +0000 (13:59 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Jul 2009 06:49:15 +0000 (09:49 +0300)
- disable dependency caching on chrooted verify to avoid ugly spew
  from paths containing outside paths while we're actually inside the
  root during verification
- correct fix would be to fix the temporary db path calculation

lib/depends.c
lib/verify.c

index a06db56..b9b8cbf 100644 (file)
@@ -32,7 +32,7 @@ struct orderListIndex_s {
     int orIndex;
 };
 
-static int _cacheDependsRC = 1;
+RPM_GNUC_INTERNAL int _cacheDependsRC = 1;
 
 const char * const rpmNAME = PACKAGE;
 
index 65fafda..4b2171e 100644 (file)
@@ -22,6 +22,7 @@
 #define S_ISDEV(m) (S_ISBLK((m)) || S_ISCHR((m)))
 
 extern int _rpmds_unspecified_epoch_noise;
+extern int _cacheDependsRC;
 
 /* If cap_compare() (Linux extension) not available, do it the hard way */
 #if WITH_CAP && !defined(HAVE_CAP_COMPARE)
@@ -471,6 +472,7 @@ int rpmcliVerify(rpmts ts, QVA_t qva, char * const * argv)
     rpmVSFlags vsflags, ovsflags;
     int ec = 0, xx;
     const char * rootDir = rpmtsRootDir(ts);
+    int cachingDeps = _cacheDependsRC;
 
     /* 
      * Open the DB + indices explicitly before possible chroot,
@@ -485,6 +487,8 @@ int rpmcliVerify(rpmts ts, QVA_t qva, char * const * argv)
            goto exit;
        } else {
            rpmtsSetChrootDone(ts, 1);
+           /* XXX temporary db path is wrong when chrooted, disable caching */
+           _cacheDependsRC = 0;
        }
     }
 
@@ -517,6 +521,7 @@ int rpmcliVerify(rpmts ts, QVA_t qva, char * const * argv)
     }
 
 exit:
+    _cacheDependsRC = cachingDeps;
 
     return ec;
 }