sssd/0077-CONFDB-Do-not-crash-with-an-invalid-domain_type-or-c.patch
2017-09-01 21:34:35 +02:00

45 lines
1.5 KiB
Diff

From 9787bc5890865be73a6caedaa22b3fae1e3aa671 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Tue, 29 Aug 2017 10:52:45 +0200
Subject: [PATCH 77/93] CONFDB: Do not crash with an invalid domain_type or
case_sensitive value
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If the domain_type parameter contained an invalid value, the error
branch wouldn't have set the 'ret' parameter to an error condition,
which might crash sssd.
The same problem occured with CONFDB_DOMAIN_CASE_SENSITIVE
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
---
src/confdb/confdb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index fd73abe5b79fcb1ba38f7a9d1db86bc3206bb481..69d1c7915ec213a946bb22987ffddcc15fee8c01 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -1345,6 +1345,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
} else {
DEBUG(SSSDBG_FATAL_FAILURE,
"Invalid value for %s\n", CONFDB_DOMAIN_CASE_SENSITIVE);
+ ret = EINVAL;
goto done;
}
} else {
@@ -1414,6 +1415,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
} else {
DEBUG(SSSDBG_FATAL_FAILURE,
"Invalid value %s for [%s]\n", tmp, CONFDB_DOMAIN_TYPE);
+ ret = EINVAL;
goto done;
}
}
--
2.14.1