From 0dbff8c45d9490ced5a245b2100467fde26f82d8 Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Fri, 2 Oct 2009 15:21:05 +0200 Subject: [PATCH] check if licences attribute in source config is a proper list of strings Signed-off-by: Gordon Hecker --- Changelog | 2 ++ local/git.lua | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/Changelog b/Changelog index 21644f2..1f39ae6 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,8 @@ NEXT: improve performance * logfiles are rotated instead of deleting them * a bug in configuration validation for files sources was fixed + * a bug in validating the licences attribute in source configurations was + fixed * unused code was removed * the faq section in the documentation was extended * outdated documentation was removed diff --git a/local/git.lua b/local/git.lua index dc47390..c32e351 100644 --- a/local/git.lua +++ b/local/git.lua @@ -150,6 +150,12 @@ function source_apply_default_licences(info, sourcename) " licences attribute is not in table format. Converting.") src.licences = { src.licences } end + for i, s in pairs(src.licences) do + if type(i) ~= "number" or type(s) ~= "string" then + e:append("licences attribute is not a list of strings") + return false, e + end + end for _,l in ipairs(src.licences) do if not info.licences[l] then e:append("unknown licence: %s", l) -- 2.39.5