Init cmnds to NULL in rule_to_priv() so we don't free a bogus pointer.
In the sssd backend, the rule_to_priv() cleanup code assumes cmnds can be passed to fn_free_values(), which was not the case if we receive an error getting values for "sudoCommand". This is a regression introduced in sudo 1.9.1. Fix from Ron Bowes. GitHub issue #67.
This commit is contained in:
@@ -240,7 +240,7 @@ static struct privilege *
|
|||||||
sss_rule_to_priv(struct sudo_sss_handle *handle, struct sss_sudo_rule *rule,
|
sss_rule_to_priv(struct sudo_sss_handle *handle, struct sss_sudo_rule *rule,
|
||||||
int *rc_out)
|
int *rc_out)
|
||||||
{
|
{
|
||||||
char **cmnds, **runasusers = NULL, **runasgroups = NULL;
|
char **cmnds = NULL, **runasusers = NULL, **runasgroups = NULL;
|
||||||
char **opts = NULL, **notbefore = NULL, **notafter = NULL;
|
char **opts = NULL, **notbefore = NULL, **notafter = NULL;
|
||||||
char **hosts = NULL, **cn_array = NULL, *cn = NULL;
|
char **hosts = NULL, **cn_array = NULL, *cn = NULL;
|
||||||
struct privilege *priv = NULL;
|
struct privilege *priv = NULL;
|
||||||
|
Reference in New Issue
Block a user