Skip to content
GitLab
探索
项目
群组
代码片段
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录
切换导航
菜单
打开侧边栏
wazuh
Osquery
提交
1699adc3
未验证
提交
1699adc3
编辑于
4年前
作者:
Teddy Reed
提交者:
GitHub
4年前
浏览文件
操作
下载
电子邮件补丁
差异文件
rpm: Add support for SQLite RPM databases (#6939)
上级
fedc9022
master
build_aarch64_run_tests
release/v5.2.3
5.3.0
5.2.3
5.2.2
5.2.1
5.2.0
5.1.0
5.0.1
5.0.0
4.9.0
4.8.0
4.7.0
无相关合并请求
变更
8
隐藏空白变更内容
行内
左右并排
显示
8 个更改的文件
Vagrantfile
+3
-0
Vagrantfile
libraries/cmake/source/librpm/CMakeLists.txt
+2
-0
libraries/cmake/source/librpm/CMakeLists.txt
libraries/cmake/source/librpm/README.md
+1
-1
libraries/cmake/source/librpm/README.md
libraries/cmake/source/librpm/config/config.h
+1
-1
libraries/cmake/source/librpm/config/config.h
osquery/tables/system/tests/linux/rpm_packages_tests.cpp
+38
-0
osquery/tables/system/tests/linux/rpm_packages_tests.cpp
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite
+0
-0
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite-shm
+0
-0
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite-shm
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite-wal
+0
-0
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite-wal
有
45 个添加
和
2 个删除
+45
-2
Vagrantfile
+
3
-
0
浏览文件 @
1699adc3
...
...
@@ -54,6 +54,9 @@ targets = {
"archlinux"
=>
{
"box"
=>
"archlinux/archlinux"
},
"fedora33"
=>
{
"box"
=>
"fedora/33-cloud-base"
},
"suse11"
=>
{
"box"
=>
"elastic/sles-11-x86_64"
},
...
...
This diff is collapsed.
Click to expand it.
libraries/cmake/source/librpm/CMakeLists.txt
+
2
-
0
浏览文件 @
1699adc3
...
...
@@ -10,6 +10,7 @@ function(librpmMain)
set
(
rpm_library_srcs
"
${
library_root
}
/lib/backend/bdb_ro.c"
"
${
library_root
}
/lib/backend/sqlite.c"
"
${
library_root
}
/lib/backend/dbi.c"
"
${
library_root
}
/lib/backend/dummydb.c"
"
${
library_root
}
/lib/backend/dbiset.c"
...
...
@@ -161,6 +162,7 @@ function(librpmMain)
endif
()
target_link_libraries
(
thirdparty_librpm PUBLIC
thirdparty_sqlite
thirdparty_openssl
thirdparty_zlib
thirdparty_libmagic
...
...
This diff is collapsed.
Click to expand it.
libraries/cmake/source/librpm/README.md
+
1
-
1
浏览文件 @
1699adc3
...
...
@@ -36,7 +36,7 @@ export LDFLAGS="${CFLAGS} -L$OPENSSL_LINK -L$LIBMAGIC_LINK -L$POPT_LINK"
export
CC
=
clang
./autogen.sh
./configure
--enable-static
--with-crypto
=
openssl
--without-archive
--enable-bdb
--enable-bdb-ro
--without-lua
--disable-plugins
--disable-openmp
./configure
--enable-static
--with-crypto
=
openssl
--without-archive
--enable-bdb
--enable-bdb-ro
--enable_sqlite
--without-lua
--disable-plugins
--disable-openmp
```
Then copy
...
...
This diff is collapsed.
Click to expand it.
libraries/cmake/source/librpm/config/config.h
+
1
-
1
浏览文件 @
1699adc3
...
...
@@ -407,7 +407,7 @@
/* #undef WITH_SELINUX */
/* Define if SQLITE is available */
/* #undef
WITH_SQLITE
*/
#define
WITH_SQLITE
1
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
...
...
This diff is collapsed.
Click to expand it.
osquery/tables/system/tests/linux/rpm_packages_tests.cpp
+
38
-
0
浏览文件 @
1699adc3
...
...
@@ -158,5 +158,43 @@ TEST_F(RpmTests, test_bdb_packages) {
EXPECT_EQ
(
expected
,
packages
);
};
TEST_F
(
RpmTests
,
test_sqlite_packages
)
{
auto
dropper
=
DropPrivileges
::
get
();
if
(
isUserAdmin
())
{
ASSERT_TRUE
(
dropper
->
dropTo
(
"nobody"
));
}
auto
sqlite_config
=
getTestConfigDirectory
()
/
"rpm"
/
"rpm-sqlite"
;
sqlite_config
=
boost
::
filesystem
::
absolute
(
sqlite_config
);
this
->
setConfig
(
sqlite_config
.
string
());
std
::
vector
<
struct
PackageDetails
>
packages
;
auto
getPackage
=
[
&
packages
](
struct
PackageDetails
&
pd
)
{
packages
.
push_back
(
pd
);
};
ASSERT_TRUE
(
queryRpmDb
(
getPackage
).
ok
());
std
::
vector
<
struct
PackageDetails
>
expected
=
{
{
"deltarpm"
,
"3.6.2"
,
"b94aeacccb128594c1c385a19a36b7237fd7bd55"
},
{
"python3-rpm"
,
"4.16.0"
,
"cb4fd19975ffb22a6c67fa1ced0dd98cf039e2c3"
},
{
"rpm"
,
"4.16.0"
,
"f1b7a4ad5d2497a44039ba20a2e83e7e60d52472"
},
{
"rpm-build-libs"
,
"4.16.0"
,
"0e964be137e7489228e91d16d16ade7a38474bce"
},
{
"rpm-libs"
,
"4.16.0"
,
"4eb167bef01b1c0684f870ef791ec4de3db96ca2"
},
{
"rpm-plugin-selinux"
,
"4.16.0"
,
"2118e44fbdbdcd7bbf8306630bf03c289a6401cc"
},
{
"rpm-plugin-systemd-inhibit"
,
"4.16.0"
,
"74890e714d68b144750b5529617361b4a4f64430"
},
{
"rpm-sign-libs"
,
"4.16.0"
,
"01c6d988e05b320c9620e66b8bda57b8dd1749fe"
},
{
"systemd-rpm-macros"
,
"246.6"
,
"50805b7fdfeef333d918a0da76c636e7ef182e36"
},
};
EXPECT_EQ
(
expected
,
packages
);
};
}
// namespace tables
}
// namespace osquery
This diff is collapsed.
Click to expand it.
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite
0 → 100644
+
0
-
0
浏览文件 @
1699adc3
文件已添加
This diff is collapsed.
Click to expand it.
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite-shm
0 → 100644
+
0
-
0
浏览文件 @
1699adc3
文件已添加
This diff is collapsed.
Click to expand it.
tools/tests/configs/rpm/rpm-sqlite/rpmdb.sqlite-wal
0 → 100644
+
0
-
0
浏览文件 @
1699adc3
This diff is collapsed.
Click to expand it.
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
菜单
探索
项目
群组
代码片段