From 44cfc09511aa7c67eb09ee5ceec5cf6f23f7f9c9 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 24 Nov 2018 15:56:13 -0800 Subject: require actual siglevel for default ALPM_SIG_USE_DEFAULT does not refer to an actual siglevel, rather it indicates that the global default should be used in place of the operation-specific one. Setting this value for the global default itself makes no sense. Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- lib/libalpm/handle.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index be5666dc..f912d2f5 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -803,10 +803,13 @@ int SYMEXPORT alpm_option_set_default_siglevel(alpm_handle_t *handle, int level) { CHECK_HANDLE(handle, return -1); + if(level == ALPM_SIG_USE_DEFAULT) { + RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1); + } #ifdef HAVE_LIBGPGME handle->siglevel = level; #else - if(level != 0 && level != ALPM_SIG_USE_DEFAULT) { + if(level != 0) { RET_ERR(handle, ALPM_ERR_MISSING_CAPABILITY_SIGNATURES, -1); } #endif -- cgit v1.2.3-70-g09d2