diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-09-10 03:05:12 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-09-10 03:05:12 +0000 |
| commit | 2bc2b430bc4c1a9a0bfd1c01da68bd53bf7da052 (patch) | |
| tree | a2af4fd609c7decacbf0ea11926ea338596fb179 /rpm-selinux-plugin-check-context-file-exist.patch | |
| parent | 0ae9f87336a3d78d8fbc0a1e5c75cba5f9cf8597 (diff) | |
automatic import of rpm
Diffstat (limited to 'rpm-selinux-plugin-check-context-file-exist.patch')
| -rw-r--r-- | rpm-selinux-plugin-check-context-file-exist.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/rpm-selinux-plugin-check-context-file-exist.patch b/rpm-selinux-plugin-check-context-file-exist.patch new file mode 100644 index 0000000..56d7982 --- /dev/null +++ b/rpm-selinux-plugin-check-context-file-exist.patch @@ -0,0 +1,26 @@ +From 55708fd5822a3e4bf5537002a648f32cb0a6e07e Mon Sep 17 00:00:00 2001 +From: luhuaxin <1539327763@qq.com> +Date: Tue, 26 Oct 2021 18:39:46 +0800 +Subject: [PATCH] rpm selinux plugin check context file exist + +--- + plugins/selinux.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/plugins/selinux.c b/plugins/selinux.c +index 1254517..fb8b7a2 100644 +--- a/plugins/selinux.c ++++ b/plugins/selinux.c +@@ -63,7 +63,8 @@ static rpmRC selinux_tsm_pre(rpmPlugin plugin, rpmts ts) + rpmRC rc = RPMRC_OK; + + /* If SELinux isn't enabled on the system, dont mess with it */ +- if (!is_selinux_enabled()) { ++ if (!is_selinux_enabled() || selinux_file_context_path() == NULL || ++ access(selinux_file_context_path(), F_OK)) { + rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_NOCONTEXTS)); + } + +-- +2.23.0 + |
