mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipadb_iterate(): handle match_entry == NULL
If match_entry == NULL all principals should be iterated. Additionally this patch adds a check in ipadb_filter_escape() to make sure that the input is not NULL. Fixes: https://fedorahosted.org/freeipa/ticket/3011
This commit is contained in:
@@ -30,6 +30,10 @@ char *ipadb_filter_escape(const char *input, bool star)
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
|
||||
if (!input) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Assume the worst-case. */
|
||||
output = malloc(strlen(input) * 3 + 1);
|
||||
if (!output) {
|
||||
|
||||
@@ -1879,6 +1879,12 @@ krb5_error_code ipadb_iterate(krb5_context kcontext,
|
||||
return KRB5_KDB_DBNOTINITED;
|
||||
}
|
||||
|
||||
/* If no match_entry is given iterate through all krb princs like the db2
|
||||
* or ldap plugin */
|
||||
if (match_entry == NULL) {
|
||||
match_entry = "*";
|
||||
}
|
||||
|
||||
/* fetch list of principal matching filter */
|
||||
kerr = ipadb_fetch_principals(ipactx, 0, match_entry, &res);
|
||||
if (kerr != 0) {
|
||||
|
||||
Reference in New Issue
Block a user