Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2018-11-24 15:56:13 -0800
committerAllan McRae <allan@archlinux.org>2018-11-27 22:48:43 +1000
commit44cfc09511aa7c67eb09ee5ceec5cf6f23f7f9c9 (patch)
tree445c5045cddd3972d3d5b3f2d88a8981d3d4ff35 /lib
parent61fe73804305a8bbb434cdc245944df5284f1964 (diff)
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 <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/handle.c5
1 files changed, 4 insertions, 1 deletions
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