diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-09-30 14:11:37 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-10-01 14:33:43 +0300 |
commit | 7ccda091c2c7cf18225b861962f952dc04a5295f (patch) | |
tree | 5556804d4fdf2721da18cde4552b5a9a4bd8c33f /src/database.c | |
parent | c269e9c24da57ab1b69ad6c80e9a1cb52b2b67d2 (diff) | |
download | apk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.tar.gz apk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.tar.bz2 apk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.tar.xz apk-tools-7ccda091c2c7cf18225b861962f952dc04a5295f.zip |
adb: introduce apk-tools database format, and few applets
This is a flat buffers inspired format that allows fast
mmaped access to the data with low overhead, signature support
and relatively good forward support.
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c index 04871c9..da7a807 100644 --- a/src/database.c +++ b/src/database.c @@ -1663,6 +1663,12 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts) dbopts->keys_dir ?: "etc/apk/keys", O_RDONLY | O_CLOEXEC); + r = adb_trust_init(&db->trust, dup(db->keys_fd), dbopts->private_keys); + if (r) { + msg = "Unable to read trusted keys"; + goto ret_r; + } + if (apk_flags & APK_OVERLAY_FROM_STDIN) { apk_flags &= ~APK_OVERLAY_FROM_STDIN; apk_db_read_overlay(db, apk_istream_from_fd(STDIN_FILENO)); @@ -1839,6 +1845,8 @@ void apk_db_close(struct apk_database *db) db->cache_remount_dir = NULL; } + adb_trust_free(&db->trust); + if (db->keys_fd) close(db->keys_fd); if (db->cache_fd) |