In usergr_matches() matched should be bool but we have to take care
to handle group_plugin_query() returning a value other than 0/1.
This commit is contained in:
@@ -862,7 +862,7 @@ done:
|
|||||||
bool
|
bool
|
||||||
usergr_matches(const char *group, const char *user, const struct passwd *pw)
|
usergr_matches(const char *group, const char *user, const struct passwd *pw)
|
||||||
{
|
{
|
||||||
int matched = false;
|
bool matched = false;
|
||||||
struct passwd *pw0 = NULL;
|
struct passwd *pw0 = NULL;
|
||||||
debug_decl(usergr_matches, SUDOERS_DEBUG_MATCH)
|
debug_decl(usergr_matches, SUDOERS_DEBUG_MATCH)
|
||||||
|
|
||||||
@@ -874,7 +874,8 @@ usergr_matches(const char *group, const char *user, const struct passwd *pw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (*group == ':' && def_group_plugin) {
|
if (*group == ':' && def_group_plugin) {
|
||||||
matched = group_plugin_query(user, group + 1, pw);
|
if (group_plugin_query(user, group + 1, pw) == true)
|
||||||
|
matched = true;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -894,7 +895,7 @@ usergr_matches(const char *group, const char *user, const struct passwd *pw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* not a Unix group, could be an external group */
|
/* not a Unix group, could be an external group */
|
||||||
if (def_group_plugin && group_plugin_query(user, group, pw)) {
|
if (def_group_plugin && group_plugin_query(user, group, pw) == true) {
|
||||||
matched = true;
|
matched = true;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user