2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Use PATH_MAX, not MAXPATHLEN since the former is standardized.

This commit is contained in:
Todd C. Miller
2004-06-01 01:22:27 +00:00
parent 3bce9860fb
commit d33ad95208
10 changed files with 25 additions and 15 deletions

View File

@@ -238,7 +238,7 @@ command_matches(cmnd, cmnd_args, path, sudoers_args)
struct stat pst;
DIR *dirp;
struct dirent *dent;
char buf[MAXPATHLEN];
char buf[PATH_MAX];
static char *cmnd_base;
/* Check for pseudo-commands */
@@ -350,7 +350,7 @@ command_matches(cmnd, cmnd_args, path, sudoers_args)
return(FALSE);
while ((dent = readdir(dirp)) != NULL) {
/* ignore paths > MAXPATHLEN (XXX - log) */
/* ignore paths > PATH_MAX (XXX - log) */
if (strlcpy(buf, path, sizeof(buf)) >= sizeof(buf) ||
strlcat(buf, dent->d_name, sizeof(buf)) >= sizeof(buf))
continue;