瀏覽代碼

Bug 732541 - Ignore error 32 when adding automember config

When you add a new automember config entry, we validate it at the
pre-op stage.  Part of this validation includes searching for child
regex rule entries.  We use the config entry DN as the search base,
but this fails when a new config entry is being added since it the
entry doesn't yet exist at the pre-op phase.  This results in the
new entry being considered invalid, which causes us to return an
unwilling to perform error that blocks the config entry from
being added.

We can safely ignore a LDAP_NO_SUCH_OBJECT error when attempting
to search for child regex rules.
Nathan Kinder 14 年之前
父節點
當前提交
7e43a2891b
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      ldap/servers/plugins/automember/automember.c

+ 4 - 1
ldap/servers/plugins/automember/automember.c

@@ -624,7 +624,10 @@ automember_parse_config_entry(Slapi_Entry * e, int apply)
     slapi_search_internal_pb(search_pb);
     slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &result);
 
-    if (LDAP_SUCCESS != result) {
+    /* If this is a new config entry being added, it won't exist yet
+     * when we are simply validating config.  We can just ignore no
+     * such object errors. */
+    if ((LDAP_SUCCESS != result) && (LDAP_NO_SUCH_OBJECT != result)) {
         slapi_log_error(SLAPI_LOG_FATAL, AUTOMEMBER_PLUGIN_SUBSYSTEM,
                         "automember_parse_config_entry: Error searching "
                         "for child rule entries for config \"%s\" (err=%d).",