Skip to content

Commit 3cbcb30

Browse files
committed
command_matches_glob: fix comparison of canonicalized parent directories
Bug #1062 --HG-- branch : 1.9
1 parent 4795e4b commit 3cbcb30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugins/sudoers/match_command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ command_matches_glob(struct sudoers_context *ctx, const char *sudoers_cmnd,
575575

576576
/* Compare the canonicalized parent directories, if possible. */
577577
if (ctx->user.cmnd_dir != NULL) {
578-
char *slash = strchr(cp, '/');
578+
char *slash = strrchr(cp, '/');
579579
if (slash != NULL) {
580580
char *resolved;
581581
*slash = '\0';

0 commit comments

Comments
 (0)