代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openldap 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 2443e986d1bee1266412ee324b821ab356301e72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= <ondra@mistotebe.net>
Date: Thu, 13 Jan 2022 11:03:47 +0000
Subject: [PATCH] ITS#9772 Allow objectClass edits that don't actually change
them
---
servers/slapd/bconfig.c | 45 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 43 insertions(+), 2 deletions(-)
diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c
index 3b1a4b3bc..7b6840be3 100644
--- a/servers/slapd/bconfig.c
+++ b/servers/slapd/bconfig.c
@@ -5895,8 +5895,49 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
if ( !oc_at ) return LDAP_OBJECT_CLASS_VIOLATION;
for (ml = op->orm_modlist; ml; ml=ml->sml_next) {
- if (ml->sml_desc == slap_schema.si_ad_objectClass)
- return rc;
+ if (ml->sml_desc == slap_schema.si_ad_objectClass) {
+ /* We'd be fine comparing the structural objectclass before and
+ * after, but AUXILIARY ocs exist so we have to check them all */
+ unsigned int i, j;
+
+ if ( ml->sml_numvals != oc_at->a_numvals ) {
+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
+ "objectclass modification disallowed" );
+ return LDAP_UNWILLING_TO_PERFORM;
+ }
+
+ for ( i = 0; i < oc_at->a_numvals; i++ ) {
+ ObjectClass *new_oc, *old_oc = oc_bvfind( &oc_at->a_vals[i] );
+ int found = 0;
+
+ if ( old_oc == NULL ) {
+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
+ "no objectClass named %s",
+ oc_at->a_vals[i].bv_val );
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+ for ( j = 0; j < ml->sml_numvals; j++ ) {
+ new_oc = oc_bvfind( &ml->sml_values[j] );
+ if ( new_oc == NULL ) {
+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
+ "no objectClass named %s",
+ ml->sml_values[j].bv_val );
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+
+ if ( old_oc == new_oc ) {
+ found = 1;
+ break;
+ }
+ }
+
+ if ( !found ) {
+ snprintf( ca->cr_msg, sizeof(ca->cr_msg),
+ "objectclass modification disallowed" );
+ return LDAP_UNWILLING_TO_PERFORM;
+ }
+ }
+ }
}
colst = count_ocs( oc_at, &nocs );
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。