From: Todd C. Miller Date: Mon, 11 Jan 2016 23:55:52 +0000 (-0700) Subject: Silence warning in digest_matches() on systems with no fexecve(2). X-Git-Tag: SUDO_1_8_16^2~76 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=089b468de730c3af912048cbf05659d7eb222bea;p=sudo Silence warning in digest_matches() on systems with no fexecve(2). --- diff --git a/plugins/sudoers/match.c b/plugins/sudoers/match.c index 460ac2d80..fcd24df9b 100644 --- a/plugins/sudoers/match.c +++ b/plugins/sudoers/match.c @@ -590,8 +590,10 @@ digest_matches(const char *file, const struct sudo_digest *sd, int *fd) 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 @@ digest_matches(const char *file, const struct sudo_digest *sd, int *fd) 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)) {