diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2020-11-18 13:56:14 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2020-12-10 13:28:07 +0200 |
commit | 79ab6469ada53d629040d849e5ba61d3d8a81d8f (patch) | |
tree | 95cb9dcb032998290ff53d20d6831b14b17412b9 | |
parent | 614ee82ee9c10b79ed2a12ddec81efc56a30a712 (diff) | |
download | rpm-79ab6469ada53d629040d849e5ba61d3d8a81d8f.tar.gz |
Stop on first failure when trying to open a database (RhBug:1898301)
If an index open fails there's no point trying to go on, things are
not going to work and at least BDB will segfault in some cases...
(cherry picked from commit fd054a40b2ba005571455d749de0423975e77651)
-rw-r--r-- | lib/rpmdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 73187630b..38e1cb53f 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -355,7 +355,7 @@ static int doOpen(rpmdb db, int justPkgs) { int rc = pkgdbOpen(db, db->db_flags, NULL); if (!justPkgs) { - for (int dbix = 0; dbix < db->db_ndbi; dbix++) { + for (int dbix = 0; rc == 0 && dbix < db->db_ndbi; dbix++) { rc += indexOpen(db, db->db_tags[dbix], db->db_flags, NULL); } } |