diff options
Diffstat (limited to 'kbx')
-rw-r--r-- | kbx/keybox-blob.c | 2 | ||||
-rw-r--r-- | kbx/keybox-dump.c | 7 | ||||
-rw-r--r-- | kbx/keybox-update.c | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c index ac49ac79c..0fced7e1c 100644 --- a/kbx/keybox-blob.c +++ b/kbx/keybox-blob.c @@ -1113,7 +1113,7 @@ _keybox_update_header_blob (KEYBOXBLOB blob, int for_openpgp) { u32 val = make_timestamp (); - /* Update the last maintenance run times tamp. */ + /* Update the last maintenance run timestamp. */ blob->blob[20] = (val >> 24); blob->blob[20+1] = (val >> 16); blob->blob[20+2] = (val >> 8); diff --git a/kbx/keybox-dump.c b/kbx/keybox-dump.c index 37646832e..55a47a403 100644 --- a/kbx/keybox-dump.c +++ b/kbx/keybox-dump.c @@ -631,6 +631,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp) int rc; unsigned long count = 0; struct file_stats_s stats; + int skipped_deleted; memset (&stats, 0, sizeof stats); @@ -639,7 +640,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp) for (;;) { - rc = _keybox_read_blob (&blob, fp, NULL); + rc = _keybox_read_blob (&blob, fp, &skipped_deleted); if (gpg_err_code (rc) == GPG_ERR_TOO_LARGE && gpg_err_source (rc) == GPG_ERR_SOURCE_KEYBOX) { @@ -656,8 +657,12 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp) if (rc) break; + count += skipped_deleted; + if (stats_only) { + stats.total_blob_count += skipped_deleted; + stats.empty_blob_count += skipped_deleted; update_stats (blob, &stats); } else diff --git a/kbx/keybox-update.c b/kbx/keybox-update.c index d22da1bf8..fbcaec7b9 100644 --- a/kbx/keybox-update.c +++ b/kbx/keybox-update.c @@ -675,7 +675,7 @@ keybox_compress (KEYBOX_HANDLE hd) { u32 last_maint = buf32_to_u32 (buffer+20); - if ( (last_maint + 3*3600) > time (NULL) ) + if ( (last_maint + 3*3600) > make_timestamp () ) { fclose (fp); _keybox_release_blob (blob); @@ -700,7 +700,7 @@ keybox_compress (KEYBOX_HANDLE hd) automagically skip any blobs flagged as deleted. Thus what we only have to do is to check all ephemeral flagged blocks whether their time has come and write out all other blobs. */ - cut_time = time(NULL) - 86400; + cut_time = make_timestamp () - 86400; first_blob = 1; skipped_deleted = 0; for (rc=0; !(read_rc = _keybox_read_blob (&blob, fp, &skipped_deleted)); |