summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-07-16 19:05:32 -0400
committerAllan McRae <allan@archlinux.org>2015-08-08 10:40:00 +1000
commitccd3a3eb9fad7b4c311a6bfb57b69a7a1a13c46a (patch)
treef1ab09e37281719830568cc6c2e8a4270fa3ed9b
parent1ee2032b7f4a7aa6de973d7671fc6af135cef9b5 (diff)
downloadpacman-ccd3a3eb9fad7b4c311a6bfb57b69a7a1a13c46a.tar.xz
check assumeinstalled for meaningful mod
assumeinstalled options are used as provisions for which MOD_EQ and MOD_ANY are the only meaningful settings. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/handle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 94452b00..a6a5861f 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -592,6 +592,8 @@ int SYMEXPORT alpm_option_remove_ignoregroup(alpm_handle_t *handle, const char *
int SYMEXPORT alpm_option_add_assumeinstalled(alpm_handle_t *handle, const alpm_depend_t *dep)
{
CHECK_HANDLE(handle, return -1);
+ ASSERT(dep->mod == ALPM_DEP_MOD_EQ || dep->mod == ALPM_DEP_MOD_ANY,
+ RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1));
handle->assumeinstalled = alpm_list_add(handle->assumeinstalled, (void *)dep);
return 0;