db: honor APK_OPENF_NO_STATE again
Do not call apk_db_read_layer() or try to process the layer
if APK_OPENF_NO_STATE is specified. It might fail because of
non-existing database directory. Based on patch by Daniel.
fixes commit 9e4dd29f
"db: prepare database reading for layers"
Fixes #10821
Reported-and-analyzed-by: Daniel Kolesa <daniel@octaforge.org>
cute-signatures
parent
62bc43d2a4
commit
00e397d564
|
@ -1730,6 +1730,7 @@ int apk_db_open(struct apk_database *db, struct apk_ctx *ac)
|
|||
apk_db_read_overlay(db, apk_istream_from_fd(STDIN_FILENO));
|
||||
}
|
||||
|
||||
if ((db->ctx->flags & APK_OPENF_NO_STATE) != APK_OPENF_NO_STATE) {
|
||||
for (i = 0; i < APK_DB_LAYER_NUM; i++) {
|
||||
r = apk_db_read_layer(db, i);
|
||||
if (r) {
|
||||
|
@ -1741,6 +1742,7 @@ int apk_db_open(struct apk_database *db, struct apk_ctx *ac)
|
|||
}
|
||||
db->active_layers |= BIT(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(ac->open_flags & APK_OPENF_NO_INSTALLED_REPO)) {
|
||||
if (apk_db_cache_active(db)) {
|
||||
|
|
Loading…
Reference in New Issue