Skip to content

Commit 14c2046

Browse files
AZero13millert
authored andcommitted
Look for the slash, not the null terminator
1 parent 756f1ef commit 14c2046

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/sudoers/match_command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ command_matches_dir(struct sudoers_context *ctx, const char *sudoers_dir,
335335
goto bad;
336336

337337
/* Make sure ctx->user.cmnd is not in a subdir of sudoers_dir. */
338-
if (strchr(ctx->user.cmnd + dlen + 1, '\0') != NULL)
338+
if (strchr(ctx->user.cmnd + dlen + 1, '/') != NULL)
339339
goto bad;
340340

341341
/* Open the file for fdexec or for digest matching. */

0 commit comments

Comments
 (0)