command_matches_glob: fix comparison of canonicalized parent directories
Bug #1062
This commit is contained in:
@@ -575,7 +575,7 @@ command_matches_glob(struct sudoers_context *ctx, const char *sudoers_cmnd,
|
|||||||
|
|
||||||
/* Compare the canonicalized parent directories, if possible. */
|
/* Compare the canonicalized parent directories, if possible. */
|
||||||
if (ctx->user.cmnd_dir != NULL) {
|
if (ctx->user.cmnd_dir != NULL) {
|
||||||
char *slash = strchr(cp, '/');
|
char *slash = strrchr(cp, '/');
|
||||||
if (slash != NULL) {
|
if (slash != NULL) {
|
||||||
char *resolved;
|
char *resolved;
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
|
Reference in New Issue
Block a user