Remove #ifdefs around code using pread(3) and pwrite(3).

This commit is contained in:
Todd C. Miller
2021-01-02 10:43:34 -07:00
parent 06bfbecd64
commit 6e1986e915
3 changed files with 2 additions and 26 deletions

View File

@@ -115,14 +115,10 @@ is_script(int fd)
char magic[2];
debug_decl(is_script, SUDOERS_DEBUG_MATCH);
if (read(fd, magic, 2) == 2) {
if (pread(fd, magic, 2, 0) == 2) {
if (magic[0] == '#' && magic[1] == '!')
ret = true;
}
if (lseek(fd, (off_t)0, SEEK_SET) == -1) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO|SUDO_DEBUG_LINENO,
"unable to rewind script fd");
}
debug_return_int(ret);
}