Skip to content

Commit

Permalink
command_matches_glob: fix comparison of canonicalized parent directories
Browse files Browse the repository at this point in the history
Bug #1062
  • Loading branch information
millert committed Dec 4, 2023
1 parent 9c3eb2f commit 8dd2967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/sudoers/match_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ command_matches_glob(struct sudoers_context *ctx, const char *sudoers_cmnd,

/* Compare the canonicalized parent directories, if possible. */
if (ctx->user.cmnd_dir != NULL) {
char *slash = strchr(cp, '/');
char *slash = strrchr(cp, '/');
if (slash != NULL) {
char *resolved;
*slash = '\0';
Expand Down

0 comments on commit 8dd2967

Please sign in to comment.