summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-11 19:02:22 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-11 19:02:22 +0300
commitaddae04c266401cf049f1188917bf3432873933c (patch)
treee2469e26d79fa4b8828d95271fe1e740559019e3 /src/database.c
parent949d375aa9c9a7fe9cec85740df9de296fab095f (diff)
downloadapk-tools-addae04c266401cf049f1188917bf3432873933c.tar.gz
apk-tools-addae04c266401cf049f1188917bf3432873933c.tar.bz2
apk-tools-addae04c266401cf049f1188917bf3432873933c.tar.xz
apk-tools-addae04c266401cf049f1188917bf3432873933c.zip
db, audit: audit symlinks (by hash of the link target)
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index b3845d5..0348ef5 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1319,7 +1319,7 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t repository)
if (apk_url_local_file(repo->url) == NULL) {
char cacheitem[PATH_MAX];
- apk_blob_checksum(repository, apk_default_checksum(), &repo->csum);
+ apk_blob_checksum(repository, apk_checksum_default(), &repo->csum);
if (apk_flags & APK_UPDATE_CACHE)
apk_repository_update(db, repo);
@@ -1567,6 +1567,16 @@ static int apk_db_install_archive_entry(void *_ctx,
struct apk_db_dir_instance *ldiri;
struct hlist_node *n;
+ if (S_ISLNK(ae->mode)) {
+ EVP_Digest(ae->link_target,
+ strlen(ae->link_target),
+ file->csum.data, NULL,
+ apk_checksum_default(),
+ NULL);
+ file->csum.type = APK_CHECKSUM_DEFAULT;
+ break;
+ }
+
if (!apk_blob_rsplit(APK_BLOB_STR(ae->link_target),
'/', &bdir, &bfile))
break;