Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
d08d554227
!19 回合上游社区补丁
From: @markeryang 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
2024-08-08 03:09:58 +00:00
markeryang
b1d425c574 Replace SELinux deprecated functions 2024-07-31 06:45:08 +00:00
openeuler-ci-bot
1b57a0636b
!14 rename the patch
From: @markeryang 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
2022-11-28 03:34:26 +00:00
markeryang
8d808c0e69 rename the patch 2022-11-25 16:12:39 +08:00
openeuler-ci-bot
c539814c4e
!9 add expected_stdout for test 018
From: @tong_1001 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
2022-08-12 02:59:36 +00:00
shixuantong
4d1a92244f add expected_stdout for test 018 2022-08-12 09:22:42 +08:00
openeuler-ci-bot
320ce68ed0 !8 upgrade version to 0.34.7
From: @xinyingchao
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-01-29 11:07:10 +08:00
yangl777
ddd36e5deb upgrade version to 0.34.7 2021-01-28 16:07:20 +08:00
openeuler-ci-bot
e5c6521414 !7 delete python2 dependency
From: @weiwei_150212
Reviewed-by: @xiezhipeng1
Signed-off-by: @xiezhipeng1
2020-11-05 10:37:33 +08:00
jinzhimin369
f91729828f remove python2 2020-10-30 10:17:59 +08:00
7 changed files with 1048774 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
From c64e990a7e70f2a4a04c93603150f2f109e85c6b Mon Sep 17 00:00:00 2001
From: Christopher Byrne <salah.coronya@gmail.com>
Date: Dec 21 2023 07:53:58 +0000
Subject: src/oddjobd.c: Fix implicit cast from const to non-const
Signed-off-by: Christopher Byrne <salah.coronya@gmail.com>
---
diff --git a/src/oddjobd.c b/src/oddjobd.c
index fa61f8a..3aa8a8f 100644
--- a/src/oddjobd.c
+++ b/src/oddjobd.c
@@ -242,8 +242,7 @@ static void check_selinux_applicable(void);
static dbus_bool_t
check_one_ac_selinux(struct oddjob_acl *acl, const char *selinux_context)
{
- char *ctx;
- const char *user, *role, *type, *range;
+ const char *ctx, *user, *role, *type, *range;
dbus_bool_t ret;
context_t context;

View File

@ -0,0 +1,35 @@
From cad3310a7390aad3e16492e8ed922f388f8895ae Mon Sep 17 00:00:00 2001
From: Christopher Byrne <salah.coronya@gmail.com>
Date: Dec 21 2023 07:53:58 +0000
Subject: src/oddjobd.c: Replace deprecated libxml2 calls
xmlInitGlobals is now an alias for xmlInitParser and xmlCleaupGlobals is
now a no-op.
Signed-off-by: Christopher Byrne <salah.coronya@gmail.com>
---
diff --git a/src/oddjobd.c b/src/oddjobd.c
index fb63c02..b27b678 100644
--- a/src/oddjobd.c
+++ b/src/oddjobd.c
@@ -1357,7 +1357,7 @@ load_config(struct oddjob_config *config,
filename);
}
- xmlInitGlobals();
+ xmlInitParser();
doc = xmlParseFile(filename);
if (doc == NULL) {
fprintf(stderr, "Error parsing configuration from \"%s\".\n",
@@ -1380,7 +1380,6 @@ load_config(struct oddjob_config *config,
}
xmlFreeDoc(doc);
- xmlCleanupGlobals();
return parsed;
}

View File

@ -0,0 +1,96 @@
From 930b92690761038f33b80566896d2abf5950a55e Mon Sep 17 00:00:00 2001
From: Christopher Byrne <salah.coronya@gmail.com>
Date: Dec 21 2023 07:53:58 +0000
Subject: src, build: Replace SELinux deprecated functions
matchpathcon_init and matchpathcon have been replaced with
selabel_open and selabel_lookup. security_context_t is now just char*
Fixes: https://pagure.io/oddjob/issue/10
Signed-off-by: Christopher Byrne <salah.coronya@gmail.com>
---
diff --git a/src/oddjobd.c b/src/oddjobd.c
index b27b678..fa61f8a 100644
--- a/src/oddjobd.c
+++ b/src/oddjobd.c
@@ -1947,7 +1947,7 @@ oddjobd_exec_method(struct oddjob_dbus_context *ctx,
/* Set up the SELinux execution context. */
if (globals.selinux_enabled) {
const char *client_secontext;
- security_context_t helper_context, exec_context;
+ char *helper_context, *exec_context;
client_secontext = oddjob_dbus_message_get_selinux_context(msg);
if (client_secontext == NULL) {
diff --git a/src/selinux.c b/src/selinux.c
index d2482cf..454eb3f 100644
--- a/src/selinux.c
+++ b/src/selinux.c
@@ -45,12 +45,7 @@
#ifdef SELINUX_LABELS
#include <selinux/selinux.h>
-
-#ifndef HAVE_MATCHPATHCON_INIT
-static void
-matchpathcon_init(const char *path) {
-}
-#endif
+#include <selinux/label.h>
static dbus_bool_t
oddjob_check_selinux_enabled(void)
@@ -58,9 +53,6 @@ oddjob_check_selinux_enabled(void)
static int selinux_enabled = -1;
if (selinux_enabled == -1) {
selinux_enabled = is_selinux_enabled();
- if (selinux_enabled == 1) {
- matchpathcon_init(NULL);
- }
}
return (selinux_enabled == 1);
}
@@ -68,24 +60,28 @@ oddjob_check_selinux_enabled(void)
void
oddjob_set_selinux_file_creation_context(const char *path, mode_t mode)
{
- security_context_t context;
+ struct selabel_handle *handle;
+ char *context;
if (!oddjob_check_selinux_enabled()) {
return;
}
- context = NULL;
- if (matchpathcon(path, mode, &context) == 0) {
- if (context != NULL) {
- if (strcmp(context, "<<none>>") == 0) {
- oddjob_unset_selinux_file_creation_context();
+ handle = selabel_open(SELABEL_CTX_FILE,NULL,0);
+ if (handle) {
+ if (selabel_lookup(handle,&context,path,mode) == 0) {
+ if (context != NULL) {
+ if (strcmp(context, "<<none>>") == 0) {
+ oddjob_unset_selinux_file_creation_context();
+ } else {
+ setfscreatecon(context);
+ }
+ freecon(context);
} else {
- setfscreatecon(context);
- }
- freecon(context);
- } else {
oddjob_unset_selinux_file_creation_context();
+ }
}
+ selabel_close(handle);
}
}

Binary file not shown.

BIN
oddjob-0.34.7.tar.gz Normal file

Binary file not shown.

View File

@ -1,12 +1,18 @@
Name: oddjob
Version: 0.34.6
Release: 1
Version: 0.34.7
Release: 4
URL: https://pagure.io/oddjob
Source0: https://releases.pagure.org/oddjob/oddjob-%{version}.tar.gz
Summary: A D-Bus service which runs odd jobs on behalf of client applications
License: BSD
Patch0: 0000-add-expected_stdout-for-test-018.patch
Patch1: backport-build-Replace-SELinux-deprecated-functions.patch
Patch2: backport-Replace-deprecated-libxml2-calls.patch
Patch3: backport-Fix-implicit-cast-from-const-to-non-const.patch
BuildRequires: gcc dbus-devel >= 0.22, dbus-x11, libselinux-devel, libxml2-devel docbook-dtds, xmlto
BuildRequires: pam-devel, python2-devel, pkgconfig cyrus-sasl-devel, krb5-devel, openldap-devel
BuildRequires: pam-devel, python3-devel, pkgconfig cyrus-sasl-devel, krb5-devel, openldap-devel
BuildRequires: systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
@ -102,6 +108,20 @@ exit 0
%{_mandir}/*/*
%changelog
* Wed Jul 31 2024 yanglongkang <yanglongkang@h-partners.com> - 0.34.7-4
- Replace SELinux deprecated functions
- Replace deprecated libxml2 calls
- Fix implicit cast from const to non const
* Fri Nov 25 2022 yanglongkang <yanglongkang@h-partners.com> - 0.34.7-3
- rename the patch
* Fri Aug 12 2022 shixuantong <shixuantong@h-partners.com> - 0.34.7-2
- add expected_stdout for test 018
* Thu Jan 28 2021 yuanxin <yuanxin24@huawei.com> - 0.34.7-1
- upgread version to 0.34.7
* Wed Jul 22 2020 shixuantong <shixuantong@huawei.com> - 0.34.6-1
- update to 0.34.6-1