From: David VaĊĦek Date: Tue, 24 Aug 2021 08:10:42 +0000 (+0200) Subject: zone-backup: silent static analyzer tools X-Git-Tag: v3.1.2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9d33a665ba82e6e78096e6375c47348990ff526;p=thirdparty%2Fknot-dns.git zone-backup: silent static analyzer tools Creating backups in obsolete format won't ever happen. --- diff --git a/src/knot/zone/backup.c b/src/knot/zone/backup.c index 8c782dfb31..1a8f6e7b79 100644 --- a/src/knot/zone/backup.c +++ b/src/knot/zone/backup.c @@ -38,7 +38,7 @@ #include "knot/zone/zonefile.h" #include "libdnssec/error.h" -// Current backup format version for output. +// Current backup format version for output. Don't decrease it. #define BACKUP_VERSION BACKUP_FORMAT_2 // Starting with release 3.1.0. static void _backup_swap(zone_backup_ctx_t *ctx, void **local, void **remote) @@ -282,6 +282,10 @@ static int backup_zonefile(conf_t *conf, zone_t *zone, zone_backup_ctx_t *ctx) conf_val_t val = conf_zone_get(conf, C_ZONEFILE_SYNC, zone->name); bool can_flush = (conf_int(&val) > -1); + // The value of ctx->backup_format is always at least BACKUP_FORMAT_2 for + // the backup mode, therefore backup_zfiles_dir is always filled at this point. + assert(backup_zfiles_dir != NULL); + ret = make_dir(backup_zfiles_dir, S_IRWXU | S_IRWXG, true); if (ret == KNOT_EOK) { if (can_flush) {