Mercurial > repos > sudo
changeset 10301:0cd3cc8fa195
Silence warning in digest_matches() on systems with no fexecve(2).
| author | Todd C. Miller <Todd.Miller@courtesan.com> |
|---|---|
| date | Mon, 11 Jan 2016 16:55:52 -0700 |
| parents | 4d2c1761c752 |
| children | e1abfdc82242 |
| files | plugins/sudoers/match.c |
| diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/sudoers/match.c Mon Jan 11 16:52:52 2016 -0700 +++ b/plugins/sudoers/match.c Mon Jan 11 16:55:52 2016 -0700 @@ -590,8 +590,10 @@ unsigned char sudoers_digest[SHA512_DIGEST_LENGTH]; unsigned char buf[32 * 1024]; struct digest_function *func = NULL; +#ifdef HAVE_FEXECVE bool first = true; bool is_script = false; +#endif /* HAVE_FEXECVE */ size_t nread; SHA2_CTX ctx; FILE *fp; @@ -635,12 +637,14 @@ func->init(&ctx); while ((nread = fread(buf, 1, sizeof(buf), fp)) != 0) { +#ifdef HAVE_FEXECVE /* Check for #! cookie and set is_script. */ if (first) { first = false; if (nread >= 2 && buf[0] == '#' && buf[1] == '!') is_script = true; } +#endif /* HAVE_FEXECVE */ func->update(&ctx, buf, nread); } if (ferror(fp)) {
