Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yara 4.5.0] Fix broken Linux builds #38941

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions ports/yara/fix-linux-build-issues.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
diff --git a/configure.ac b/configure.ac
index bc23ee9fba..4a518f181e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,9 +32,6 @@ AC_C_INLINE
# Defines WORDS_BIGENDIAN if building in a big-endian host.
AC_C_BIGENDIAN

-# Arrange for 64-bit file offsets.
-AC_SYS_LARGEFILE
-
LT_INIT
AC_CANONICAL_HOST

diff --git a/libyara/proc/linux.c b/libyara/proc/linux.c
index 72f2ab48bc..9947d02001 100644
--- a/libyara/proc/linux.c
+++ b/libyara/proc/linux.c
@@ -29,6 +29,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#if defined(USE_LINUX_PROC)

+#define _FILE_OFFSET_BITS 64
+
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
@@ -249,7 +251,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block)
// target process VM.
if (fd == -1)
{
- if (pread64(
+ if (pread(
proc_info->mem_fd,
(void*) context->buffer,
block->size,
@@ -265,7 +267,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block)
{
goto _exit;
}
- if (pread64(
+ if (pread(
proc_info->pagemap_fd,
pagemap,
sizeof(uint64_t) * block->size / page_size,
@@ -284,7 +286,7 @@ YR_API const uint8_t* yr_process_fetch_memory_block_data(YR_MEMORY_BLOCK* block)
// swap-backed and if it differs from our mapping.
uint8_t buffer[page_size];

- if (pread64(
+ if (pread(
proc_info->mem_fd,
buffer,
page_size,
2 changes: 2 additions & 0 deletions ports/yara/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ vcpkg_from_github(
PATCHES
# Module elf request new library tlshc(https://github.com/avast/tlshc), the related upstream PR: https://github.com/VirusTotal/yara/pull/1624.
Disable-module-elf.patch
# Linux builds are broken on various distributions (https://github.com/VirusTotal/yara/issues/2050), this is the backported fix for this issues
fix-linux-build-issues.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
1 change: 1 addition & 0 deletions ports/yara/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "yara",
"version": "4.5.0",
"port-version": 1,
"description": "The pattern matching swiss knife",
"homepage": "https://github.com/VirusTotal/yara",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9586,7 +9586,7 @@
},
"yara": {
"baseline": "4.5.0",
"port-version": 0
"port-version": 1
},
"yas": {
"baseline": "7.1.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/y-/yara.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "df3fbbb41b3f1e87d91f1c361f13286c627b606b",
"version": "4.5.0",
"port-version": 1
},
{
"git-tree": "36109d80198f355066776d9166f4ab7f564a91f3",
"version": "4.5.0",
Expand Down
Loading