Use sys/stat.h defines instead of bare octal values.

This commit is contained in:
Todd C. Miller
2016-11-07 13:36:05 -07:00
parent 2b020c9f17
commit 8133cdfdf6
12 changed files with 43 additions and 23 deletions

View File

@@ -52,7 +52,7 @@ sudo_goodpath(const char *path, struct stat *sbp)
if (stat(path, sbp) == 0) {
/* Make sure path describes an executable regular file. */
if (S_ISREG(sbp->st_mode) && ISSET(sbp->st_mode, 0111))
if (S_ISREG(sbp->st_mode) && ISSET(sbp->st_mode, S_IXUSR|S_IXGRP|S_IXOTH))
ret = true;
else
errno = EACCES;