=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/match.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/sudo/Attic/match.c 2009/06/21 14:48:42 1.3 +++ src/usr.bin/sudo/Attic/match.c 2009/12/07 18:43:10 1.4 @@ -94,7 +94,7 @@ #endif /* USING_NONUNIX_GROUPS */ #ifndef lint -__unused static const char rcsid[] = "$Sudo: match.c,v 1.46 2009/05/27 00:49:07 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: match.c,v 1.48 2009/11/23 15:56:14 millert Exp $"; #endif /* lint */ static struct member_list empty; @@ -318,14 +318,12 @@ struct member_list *list; { struct member *m; - int rval, matched = UNSPEC; + int matched = UNSPEC; tq_foreach_rev(list, m) { - rval = cmnd_matches(m); - if (rval != UNSPEC) { - matched = m->negated ? !rval : rval; + matched = cmnd_matches(m); + if (matched != UNSPEC) break; - } } return(matched); } @@ -580,8 +578,10 @@ if (dirp == NULL) return(FALSE); - if (strlcpy(buf, sudoers_dir, sizeof(buf)) >= sizeof(buf)) + if (strlcpy(buf, sudoers_dir, sizeof(buf)) >= sizeof(buf)) { + closedir(dirp); return(FALSE); + } while ((dent = readdir(dirp)) != NULL) { /* ignore paths > PATH_MAX (XXX - log) */ buf[dlen] = '\0';