@@ -154,7 +154,7 @@ runas_getgroups(const struct sudoers_context *ctx)
154154 */
155155static int
156156runas_userlist_matches (const struct sudoers_parse_tree * parse_tree ,
157- const struct member_list * user_list , struct member * * matching_user )
157+ const struct member_list * user_list )
158158{
159159 const struct sudoers_context * ctx = parse_tree -> ctx ;
160160 const char * lhost = parse_tree -> lhost ? parse_tree -> lhost : ctx -> runas .host ;
@@ -184,7 +184,7 @@ runas_userlist_matches(const struct sudoers_parse_tree *parse_tree,
184184 a = alias_get (parse_tree , m -> name , RUNASALIAS );
185185 if (a != NULL ) {
186186 const int rc = runas_userlist_matches (parse_tree ,
187- & a -> members , matching_user );
187+ & a -> members );
188188 if (SPECIFIED (rc )) {
189189 if (m -> negated ) {
190190 user_matched = rc == ALLOW ? DENY : ALLOW ;
@@ -212,11 +212,6 @@ runas_userlist_matches(const struct sudoers_parse_tree *parse_tree,
212212 user_matched = m -> negated ? DENY : ALLOW ;
213213 break ;
214214 }
215- if (SPECIFIED (user_matched )) {
216- if (matching_user != NULL && m -> type != ALIAS )
217- * matching_user = m ;
218- break ;
219- }
220215 }
221216 debug_return_int (user_matched );
222217}
@@ -228,7 +223,7 @@ runas_userlist_matches(const struct sudoers_parse_tree *parse_tree,
228223 */
229224static int
230225runas_grouplist_matches (const struct sudoers_parse_tree * parse_tree ,
231- const struct member_list * group_list , struct member * * matching_group )
226+ const struct member_list * group_list )
232227{
233228 const struct sudoers_context * ctx = parse_tree -> ctx ;
234229 int group_matched = UNSPEC ;
@@ -246,7 +241,7 @@ runas_grouplist_matches(const struct sudoers_parse_tree *parse_tree,
246241 a = alias_get (parse_tree , m -> name , RUNASALIAS );
247242 if (a != NULL ) {
248243 const int rc = runas_grouplist_matches (parse_tree ,
249- & a -> members , matching_group );
244+ & a -> members );
250245 if (SPECIFIED (rc )) {
251246 if (m -> negated ) {
252247 group_matched = rc == ALLOW ? DENY : ALLOW ;
@@ -263,11 +258,6 @@ runas_grouplist_matches(const struct sudoers_parse_tree *parse_tree,
263258 group_matched = m -> negated ? DENY : ALLOW ;
264259 break ;
265260 }
266- if (SPECIFIED (group_matched )) {
267- if (matching_group != NULL && m -> type != ALIAS )
268- * matching_group = m ;
269- break ;
270- }
271261 }
272262 }
273263 if (!SPECIFIED (group_matched )) {
@@ -303,8 +293,7 @@ runas_grouplist_matches(const struct sudoers_parse_tree *parse_tree,
303293 */
304294int
305295runaslist_matches (const struct sudoers_parse_tree * parse_tree ,
306- const struct member_list * user_list , const struct member_list * group_list ,
307- struct member * * matching_user , struct member * * matching_group )
296+ const struct member_list * user_list , const struct member_list * group_list )
308297{
309298 const struct sudoers_context * ctx = parse_tree -> ctx ;
310299 struct member_list _user_list = TAILQ_HEAD_INITIALIZER (_user_list );
@@ -319,13 +308,11 @@ runaslist_matches(const struct sudoers_parse_tree *parse_tree,
319308 m_user .negated = false;
320309 TAILQ_INSERT_HEAD (& _user_list , & m_user , entries );
321310 user_list = & _user_list ;
322- matching_user = NULL ;
323311 }
324312
325- user_matched = runas_userlist_matches (parse_tree , user_list , matching_user );
313+ user_matched = runas_userlist_matches (parse_tree , user_list );
326314 if (ISSET (ctx -> settings .flags , RUNAS_GROUP_SPECIFIED )) {
327- group_matched = runas_grouplist_matches (parse_tree , group_list ,
328- matching_group );
315+ group_matched = runas_grouplist_matches (parse_tree , group_list );
329316 }
330317
331318 if (user_matched == DENY || group_matched == DENY )
0 commit comments