!111 [sync] PR-110: Avoid invalid string access when LDAP auth is enabled, but LDAP secret is not set.
From: @openeuler-sync-bot Reviewed-by: @liuqinfei Signed-off-by: @liuzhiqiang26
This commit is contained in:
commit
0105afecc6
31
0025-fix-rgw-ldap-safe_read_file-can-return-0.patch
Normal file
31
0025-fix-rgw-ldap-safe_read_file-can-return-0.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From 65cd8accc127c6765f083a389455ce73b7517e11 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matt Benjamin <mbenjamin@redhat.com>
|
||||||
|
Date: Fri, 4 Jan 2019 15:31:56 -0500
|
||||||
|
Subject: [PATCH] rgw ldap: safe_read_file can return < 0
|
||||||
|
|
||||||
|
Avoid invalid string access when LDAP auth is enabled, but LDAP
|
||||||
|
secret is not set. This is Casey's fix for the problem.
|
||||||
|
|
||||||
|
Fixes: https://tracker.ceph.com/issues/24228
|
||||||
|
|
||||||
|
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
|
||||||
|
---
|
||||||
|
src/rgw/rgw_ldap.cc | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/rgw/rgw_ldap.cc b/src/rgw/rgw_ldap.cc
|
||||||
|
index a39afa6c..d1681641 100644
|
||||||
|
--- a/src/rgw/rgw_ldap.cc
|
||||||
|
+++ b/src/rgw/rgw_ldap.cc
|
||||||
|
@@ -27,7 +27,7 @@ std::string parse_rgw_ldap_bindpw(CephContext* ctx)
|
||||||
|
memset(bindpw, 0, 1024);
|
||||||
|
int pwlen = safe_read_file("" /* base */, ldap_secret.c_str(),
|
||||||
|
bindpw, 1023);
|
||||||
|
- if (pwlen) {
|
||||||
|
+ if (pwlen > 0) {
|
||||||
|
ldap_bindpw = bindpw;
|
||||||
|
boost::algorithm::trim(ldap_bindpw);
|
||||||
|
if (ldap_bindpw.back() == '\n')
|
||||||
|
--
|
||||||
|
2.30.0
|
||||||
|
|
||||||
@ -68,7 +68,7 @@
|
|||||||
#################################################################################
|
#################################################################################
|
||||||
Name: ceph
|
Name: ceph
|
||||||
Version: 12.2.8
|
Version: 12.2.8
|
||||||
Release: 20
|
Release: 21
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
|
|
||||||
# define _epoch_prefix macro which will expand to the empty string if epoch is
|
# define _epoch_prefix macro which will expand to the empty string if epoch is
|
||||||
@ -108,6 +108,7 @@ Patch21: 0021-common-mempool-Add-test-for-mempool-shards.patch
|
|||||||
Patch22: 0022-common-mempool-Modify-shard-selection-function.patch
|
Patch22: 0022-common-mempool-Modify-shard-selection-function.patch
|
||||||
Patch23: 0023-common-mempool-only-fail-tests-if-sharding-is-very-b.patch
|
Patch23: 0023-common-mempool-only-fail-tests-if-sharding-is-very-b.patch
|
||||||
Patch24: 0024-CVE-2021-3979.patch
|
Patch24: 0024-CVE-2021-3979.patch
|
||||||
|
Patch25: 0025-fix-rgw-ldap-safe_read_file-can-return-0.patch
|
||||||
|
|
||||||
Requires: glibc >= 2.28-66
|
Requires: glibc >= 2.28-66
|
||||||
|
|
||||||
@ -1856,6 +1857,9 @@ exit 0
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 23 2022 wangzengliang <wangzengliang1@huawei.com> - 2:12.2.8-21
|
||||||
|
- fix rgw ldap:safe_read_file can return 0
|
||||||
|
|
||||||
* Sun Jan 29 2022 luo rixin <luorixin@huawei.com> - 1:12.2.8-20
|
* Sun Jan 29 2022 luo rixin <luorixin@huawei.com> - 1:12.2.8-20
|
||||||
- fix CVE-2021-3979
|
- fix CVE-2021-3979
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user