[pacman-dev] [PATCH 3/3] require actual siglevel for default

Andrew Gregory andrew.gregory.8 at gmail.com
Sat Nov 24 23:56:13 UTC 2018


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 at gmail.com>
---
 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
-- 
2.19.1


More information about the pacman-dev mailing list