X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=match.c;h=71fa82224f119daad6447ff6f1fc8af3777bcd5d;hb=f5652719a6abcf33b9464dcabb3ba4dbe23dbd01;hp=c0f917b25bb52ba54f2960c3043e15041f640660;hpb=f1001ea55f51d8362d6f1227830c17e22a9a96f9;p=debian%2Fsudo diff --git a/match.c b/match.c index c0f917b..71fa822 100644 --- a/match.c +++ b/match.c @@ -93,10 +93,6 @@ # include "nonunix.h" #endif /* USING_NONUNIX_GROUPS */ -#ifndef lint -__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; static int command_matches_dir __P((char *, size_t)); @@ -379,7 +375,7 @@ command_matches(sudoers_cmnd, sudoers_args) char *sudoers_args; { /* Check for pseudo-commands */ - if (strchr(user_cmnd, '/') == NULL) { + if (sudoers_cmnd[0] != '/') { /* * Return true if both sudoers_cmnd and user_cmnd are "sudoedit" AND * a) there are no args in sudoers OR @@ -469,7 +465,7 @@ command_matches_glob(sudoers_cmnd, sudoers_args) * else return false. */ #define GLOB_FLAGS (GLOB_NOSORT | GLOB_MARK | GLOB_BRACE | GLOB_TILDE) - if (glob(sudoers_cmnd, GLOB_FLAGS, NULL, &gl) != 0) { + if (glob(sudoers_cmnd, GLOB_FLAGS, NULL, &gl) != 0 || gl.gl_pathc == 0) { globfree(&gl); return(FALSE); }