Skip to content

Commit

Permalink
libs: Update rpm to 4.18.2 (osquery#8388)
Browse files Browse the repository at this point in the history
  • Loading branch information
Smjert authored Jul 30, 2024
1 parent 988f6db commit f47e879
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 59 deletions.
16 changes: 12 additions & 4 deletions libraries/cmake/source/librpm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

You will need to build the following osquery targets first: thirdparty_popt, thirdparty_libmagic, thirdparty_lzma, thirdparty_sqlite, thirdparty_zlib, thirdparty_zstd, openssl.

Then create the following symlinks for each library, excluded openssl (run from the build folder):
Then create the following symlinks for each library, excluded openssl, from the root of the build folder:

```
ln -s libthirdparty_popt.a libs/src/popt/libpopt.a
ln -s libthirdparty_libmagic.a libs/src/libmagic/libmagic.a
ln -s libthirdparty_lzma.a libs/src/lzma/liblzma.a
ln -s libthirdparty_sqlite.a libs/src/sqlite/src/libsqlite.a
ln -s libthirdparty_sqlite.a libs/src/sqlite/libsqlite.a
ln -s libthirdparty_zlib.a libs/src/zlib/libz.a
ln -s libthirdparty_zstd.a libs/src/zstd/libzstd.a
```
Expand Down Expand Up @@ -39,7 +39,7 @@ export ZLIB_INCLUDE="${LIBS_SRC}/libraries/cmake/source/zlib/src"
export ZLIB_LINK="${LIBS_BUILD}/libs/src/zlib"
export LZMA_INCLUDE="${LIBS_SRC}/libraries/cmake/source/lzma/src/src/liblzma/api"
export LZMA_LINK="${LIBS_BUILD}/libs/src/lzma"
export SQLITE_LIBS="-L${LIBS_BUILD}/libs/src/sqlite/src -lsqlite"
export SQLITE_LIBS="-L${LIBS_BUILD}/libs/src/sqlite -lsqlite"
export SQLITE_CFLAGS="-I${LIBS_SRC}/libraries/cmake/source/sqlite/src/src"
export ZSTD_LIBS="-L${LIBS_BUILD}/libs/src/zstd -lzstd"
export ZSTD_CFLAGS="-I${LIBS_SRC}/libraries/cmake/source/zstd/src/lib"
Expand All @@ -60,7 +60,15 @@ autoreconf -i
--enable-ndb \
--disable-plugins \
--disable-openmp \
--disable-libelf
--disable-libelf \
--without-acl \
--without-imaevm \
--without-selinux \
--without-fsverity \
--without-fapolicyd \
--without-audit \
--without-cap \
--without-readline
```

Then copy these files to the osquery source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,9 @@ index d9e4f45b5..167d4e2a2 100644
@WITH_MAGIC_LIB@

diff --git a/configure.ac b/configure.ac
index fbbfead89..f0a95841b 100644
index 340cff070..7fbcb874d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -545,7 +545,7 @@ fi
AM_CONDITIONAL([SQLITE], [test "x$have_sqlite" = "xyes"])
AC_SUBST(DB_BACKEND)

-AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])
AM_ICONV

@@ -782,13 +782,6 @@ AS_IF([test "$with_acl" = yes],[
AC_SUBST(WITH_ACL_LIB)
AM_CONDITIONAL(ACL,[test "$with_acl" = yes])
Expand Down
10 changes: 5 additions & 5 deletions libraries/cmake/source/librpm/config/aarch64/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
/* Have cap_compare function? */
/* #undef HAVE_CAP_COMPARE */

/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
/* #undef HAVE_CFLOCALECOPYCURRENT */

/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */

Expand Down Expand Up @@ -351,7 +351,7 @@
#define PACKAGE_NAME "rpm"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "rpm 4.18.0"
#define PACKAGE_STRING "rpm 4.18.2"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "rpm"
Expand All @@ -360,7 +360,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.18.0"
#define PACKAGE_VERSION "4.18.2"

/* canonical vendor */
#define RPMCANONVENDOR "unknown"
Expand Down Expand Up @@ -397,7 +397,7 @@


/* Version number of package */
#define VERSION "4.18.0"
#define VERSION "4.18.2"

/* Build with acl support? */
/* #undef WITH_ACL */
Expand Down
12 changes: 6 additions & 6 deletions libraries/cmake/source/librpm/config/x86_64/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
/* Have cap_compare function? */
/* #undef HAVE_CAP_COMPARE */

/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
/* #undef HAVE_CFLOCALECOPYCURRENT */

/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
the CoreFoundation framework. */
/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */

Expand Down Expand Up @@ -352,7 +352,7 @@
#define PACKAGE_NAME "rpm"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "rpm 4.18.0"
#define PACKAGE_STRING "rpm 4.18.2"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "rpm"
Expand All @@ -361,7 +361,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.18.0"
#define PACKAGE_VERSION "4.18.2"

/* canonical vendor */
#define RPMCANONVENDOR "unknown"
Expand Down Expand Up @@ -398,7 +398,7 @@


/* Version number of package */
#define VERSION "4.18.0"
#define VERSION "4.18.2"

/* Build with acl support? */
/* #undef WITH_ACL */
Expand Down Expand Up @@ -447,7 +447,7 @@

/* A full path to a program, possibly with arguments, that will create a
directory and all necessary parent directories, ala 'mkdir -p' */
#define __MKDIR_P "/bin/mkdir -p"
#define __MKDIR_P "/usr/bin/mkdir -p"

/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
Expand Down
67 changes: 36 additions & 31 deletions libraries/cmake/source/librpm/patches/src/remove-lua.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index bd3da196d..01baf9e02 100644
index f3e415aa2..7e09bb141 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -323,8 +323,6 @@ int addSource(rpmSpec spec, int specline, const char *srcname, rpmTagVal tag)
Expand All @@ -12,10 +12,10 @@ index bd3da196d..01baf9e02 100644
return RPMRC_FAIL;

diff --git a/build/parseSpec.c b/build/parseSpec.c
index 18c480d6e..9b46f7b33 100644
index 043a50e6b..9d80b9fa4 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -983,7 +983,6 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
@@ -982,7 +982,6 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
case PART_TRANSFILETRIGGERIN:
case PART_TRANSFILETRIGGERUN:
case PART_TRANSFILETRIGGERPOSTUN:
Expand All @@ -24,30 +24,34 @@ index 18c480d6e..9b46f7b33 100644

case PART_FILES:
diff --git a/build/spec.c b/build/spec.c
index 1a59266ac..619750906 100644
index c43124c49..8544fef39 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -249,7 +249,6 @@ rpmSpec newSpec(void)
@@ -250,7 +250,6 @@ rpmSpec newSpec(void)
spec->macros = rpmGlobalMacroContext;
spec->pool = rpmstrPoolCreate();

- specLuaInit(spec);
return spec;
}

@@ -298,7 +297,6 @@ rpmSpec rpmSpecFree(rpmSpec spec)

// only destroy lua tables if there are no BASpecs left
if (spec->recursing || spec->BACount == 0) {
- specLuaFini(spec);
@@ -297,11 +296,6 @@ rpmSpec rpmSpecFree(rpmSpec spec)
}
spec->BANames = _free(spec->BANames);

- // only destroy lua tables if there are no BASpecs left
- if (spec->recursing || spec->BACount == 0) {
- specLuaFini(spec);
- }
-
spec->sources = freeSources(spec->sources);
spec->packages = freePackages(spec->packages);
spec->pool = rpmstrPoolFree(spec->pool);
diff --git a/lib/psm.c b/lib/psm.c
index e7cc6514c..a2718e5e6 100644
index e7cc6514c..2cdddb334 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -245,19 +245,6 @@ exit:
@@ -245,18 +245,6 @@ exit:
static rpmRC runInstScript(rpmpsm psm, rpmTagVal scriptTag)
{
rpmRC rc = RPMRC_OK;
Expand All @@ -63,11 +67,10 @@ index e7cc6514c..a2718e5e6 100644
-
- rpmScriptFree(script);
- headerFree(h);
-
return rc;
}

@@ -277,59 +264,7 @@ static rpmRC handleOneTrigger(rpmts ts, rpmte te, rpmsenseFlags sense,
@@ -277,59 +265,7 @@ static rpmRC handleOneTrigger(rpmts ts, rpmte te, rpmsenseFlags sense,
Header sourceH, Header trigH, int countCorrection,
int arg2, unsigned char * triggersAlreadyRun)
{
Expand Down Expand Up @@ -158,10 +161,10 @@ index 15832289f..35a811115 100644
rpmrcCtxRelease(ctx);
return;
diff --git a/lib/rpmtriggers.c b/lib/rpmtriggers.c
index 3f8fa22d0..71e7fbffe 100644
index 3f8fa22d0..59cb797ec 100644
--- a/lib/rpmtriggers.c
+++ b/lib/rpmtriggers.c
@@ -160,38 +160,7 @@ void rpmtriggersPrepPostUnTransFileTrigs(rpmts ts, rpmte te)
@@ -160,38 +160,8 @@ void rpmtriggersPrepPostUnTransFileTrigs(rpmts ts, rpmte te)

int runPostUnTransFileTrigs(rpmts ts)
{
Expand All @@ -171,7 +174,7 @@ index 3f8fa22d0..71e7fbffe 100644
- rpmScript script;
- rpmtriggers trigs = ts->trigs2run;
int nerrors = 0;
-
- rpmtriggersSortAndUniq(trigs);
- /* Iterate over stored triggers */
- for (i = 0; i < trigs->count; i++) {
Expand Down Expand Up @@ -200,7 +203,7 @@ index 3f8fa22d0..71e7fbffe 100644
return nerrors;
}

@@ -382,68 +351,6 @@ static int runHandleTriggersInPkg(rpmts ts, rpmte te, Header h,
@@ -382,67 +352,6 @@ static int runHandleTriggersInPkg(rpmts ts, rpmte te, Header h,
int searchMode, int ti)
{
int nerrors = 0;
Expand Down Expand Up @@ -265,11 +268,10 @@ index 3f8fa22d0..71e7fbffe 100644
- }
- rpmdsFree(rpmdsTrigger);
- rpmdsFree(rpmdsTriggers);
-
return nerrors;
}

@@ -487,94 +394,7 @@ static int matchFilesInTran(rpmts ts, rpmte te, const char *pfx,
@@ -487,94 +396,7 @@ static int matchFilesInTran(rpmts ts, rpmte te, const char *pfx,
rpmRC runFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense,
rpmscriptTriggerModes tm, int priorityClass)
{
Expand Down Expand Up @@ -366,10 +368,10 @@ index 3f8fa22d0..71e7fbffe 100644

rpmRC runImmedFileTriggers(rpmts ts, rpmte te, rpmsenseFlags sense,
diff --git a/lib/transaction.c b/lib/transaction.c
index 456c0c6de..7742bc953 100644
index 456c0c6de..5687e87e9 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1697,50 +1697,7 @@ rpmRC rpmtsSetupTransactionPlugins(rpmts ts)
@@ -1697,52 +1697,7 @@ rpmRC rpmtsSetupTransactionPlugins(rpmts ts)
rpmRC runScript(rpmts ts, rpmte te, Header h, ARGV_const_t prefixes,
rpmScript script, int arg1, int arg2)
{
Expand Down Expand Up @@ -417,12 +419,14 @@ index 456c0c6de..7742bc953 100644
-
- if (te != xte)
- rpmteFree(te);
+ rpmRC rc = RPMRC_OK;
return rc;
-
- return rc;
+ return RPMRC_OK;
}

static void rpmtsSync(rpmts ts)
diff --git a/rpmio/expression.c b/rpmio/expression.c
index 98a44bbdb..389c7d95a 100644
index 98a44bbdb..3a09b99cd 100644
--- a/rpmio/expression.c
+++ b/rpmio/expression.c
@@ -21,7 +21,6 @@
Expand Down Expand Up @@ -480,7 +484,7 @@ index 98a44bbdb..389c7d95a 100644
static Value doFunction(ParseState state)
{
Value vname = state->tokenValue;
@@ -589,11 +548,7 @@ static Value doFunction(ParseState state)
@@ -589,11 +548,8 @@ static Value doFunction(ParseState state)
if (rdToken(state))
goto exit;

Expand All @@ -489,12 +493,13 @@ index 98a44bbdb..389c7d95a 100644
- v = doLuaFunction(state, vname->data.s + 4, narg, varg);
- else
- exprErr(state, _("unsupported funcion"), state->p);
+
+ exprErr(state, _("unsupported funcion"), state->p);

exit:
for (i = 0; i < narg; i++)
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 6b0201a4c..9b0d6b13f 100644
index b795fd230..da206d1a0 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -25,7 +25,6 @@
Expand All @@ -505,7 +510,7 @@ index 6b0201a4c..9b0d6b13f 100644
#include "rpmio/rpmmacro_internal.h"
#include "debug.h"

@@ -1064,36 +1063,6 @@ static void doOutput(MacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed
@@ -1073,36 +1072,6 @@ static void doOutput(MacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed

static void doLua(MacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed)
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/cmake/source/librpm/src
Submodule src updated 175 files
4 changes: 2 additions & 2 deletions libraries/third_party_libraries_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@
"librpm": {
"product": "rpm",
"vendor": "rpm",
"version": "4.18.0",
"commit": "ea0d77c52e176e2876fdb1d07ad41e9e2635a93e",
"version": "4.18.2",
"commit": "9fc611e38004b1ddaa6668297408649ed556c157",
"ignored-cves": []
},
"libudev": {
Expand Down

0 comments on commit f47e879

Please sign in to comment.