This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch master
in repository 389-ds-base.
The following commit(s) were added to refs/heads/master by this push:
new 9130787 Ticket 50090 - refactor fetch_attr() to slapi_fetch_attr()
9130787 is described below
commit 913078781712a92ac25193d6ae87bb92b2b26a67
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Fri Dec 14 13:14:05 2018 -0500
Ticket 50090 - refactor fetch_attr() to slapi_fetch_attr()
Description: fetch_attr was recetnly moved toeh public api. This
naming context is conflicting with other applications.
Appropriately changing the name to start with "slapi_"
https://pagure.io/389-ds-base/issue/50090
Reviewed by: mreynolds(one line commit rule)
---
ldap/servers/plugins/automember/automember.c | 18 +++---
ldap/servers/plugins/linkedattrs/fixup_task.c | 2 +-
ldap/servers/plugins/memberof/memberof.c | 4 +-
.../plugins/posix-winsync/posix-group-task.c | 4 +-
.../plugins/replication/repl5_replica_config.c | 12 ++--
.../plugins/replication/windows_protocol_util.c | 2 +-
ldap/servers/plugins/schema_reload/schema_reload.c | 4 +-
ldap/servers/plugins/syntaxes/validate_task.c | 4 +-
ldap/servers/slapd/slapi-plugin.h | 2 +-
ldap/servers/slapd/task.c | 68 +++++++++++-----------
ldap/servers/slapd/test-plugins/sampletask.c | 4 +-
ldap/servers/slapd/util.c | 2 +-
12 files changed, 63 insertions(+), 63 deletions(-)
diff --git a/ldap/servers/plugins/automember/automember.c
b/ldap/servers/plugins/automember/automember.c
index d982d49..08d9e49 100644
--- a/ldap/servers/plugins/automember/automember.c
+++ b/ldap/servers/plugins/automember/automember.c
@@ -2018,17 +2018,17 @@ automember_task_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry
*eAfter __attr
/*
* Grab the task params
*/
- if ((base_dn = fetch_attr(e, "basedn", 0)) == NULL) {
+ if ((base_dn = slapi_fetch_attr(e, "basedn", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((filter = fetch_attr(e, "filter", 0)) == NULL) {
+ if ((filter = slapi_fetch_attr(e, "filter", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- scope = fetch_attr(e, "scope", "sub");
+ scope = slapi_fetch_attr(e, "scope", "sub");
/*
* setup our task data
*/
@@ -2245,22 +2245,22 @@ automember_task_add_export_updates(Slapi_PBlock *pb, Slapi_Entry
*e, Slapi_Entry
*returncode = LDAP_SUCCESS;
- if ((ldif = fetch_attr(e, "ldif", 0)) == NULL) {
+ if ((ldif = slapi_fetch_attr(e, "ldif", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((base_dn = fetch_attr(e, "basedn", 0)) == NULL) {
+ if ((base_dn = slapi_fetch_attr(e, "basedn", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((filter = fetch_attr(e, "filter", 0)) == NULL) {
+ if ((filter = slapi_fetch_attr(e, "filter", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- scope = fetch_attr(e, "scope", "sub");
+ scope = slapi_fetch_attr(e, "scope", "sub");
slapi_pblock_get(pb, SLAPI_REQUESTOR_DN, &bind_dn);
@@ -2453,12 +2453,12 @@ automember_task_add_map_entries(Slapi_PBlock *pb, Slapi_Entry *e,
Slapi_Entry *e
/*
* Get the params
*/
- if ((ldif_in = fetch_attr(e, "ldif_in", 0)) == NULL) {
+ if ((ldif_in = slapi_fetch_attr(e, "ldif_in", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((ldif_out = fetch_attr(e, "ldif_out", 0)) == NULL) {
+ if ((ldif_out = slapi_fetch_attr(e, "ldif_out", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
diff --git a/ldap/servers/plugins/linkedattrs/fixup_task.c
b/ldap/servers/plugins/linkedattrs/fixup_task.c
index 4929714..4c7ab8c 100644
--- a/ldap/servers/plugins/linkedattrs/fixup_task.c
+++ b/ldap/servers/plugins/linkedattrs/fixup_task.c
@@ -51,7 +51,7 @@ linked_attrs_fixup_task_add(Slapi_PBlock *pb,
}
/* get arg(s) and setup our task data */
- linkdn = fetch_attr(e, "linkdn", 0);
+ linkdn = slapi_fetch_attr(e, "linkdn", 0);
if (linkdn) {
mytaskdata->linkdn = slapi_dn_normalize(slapi_ch_strdup(linkdn));
}
diff --git a/ldap/servers/plugins/memberof/memberof.c
b/ldap/servers/plugins/memberof/memberof.c
index e67ed97..329a845 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -2889,13 +2889,13 @@ memberof_task_add(Slapi_PBlock *pb,
*returncode = LDAP_SUCCESS;
/* get arg(s) */
- if ((dn = fetch_attr(e, "basedn", 0)) == NULL) {
+ if ((dn = slapi_fetch_attr(e, "basedn", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((filter = fetch_attr(e, "filter",
"(|(objectclass=inetuser)(objectclass=inetadmin)(objectclass=nsmemberof))")) ==
NULL) {
+ if ((filter = slapi_fetch_attr(e, "filter",
"(|(objectclass=inetuser)(objectclass=inetadmin)(objectclass=nsmemberof))")) ==
NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
diff --git a/ldap/servers/plugins/posix-winsync/posix-group-task.c
b/ldap/servers/plugins/posix-winsync/posix-group-task.c
index d8b6add..922c4f7 100644
--- a/ldap/servers/plugins/posix-winsync/posix-group-task.c
+++ b/ldap/servers/plugins/posix-winsync/posix-group-task.c
@@ -66,7 +66,7 @@ posix_group_task_add(Slapi_PBlock *pb __attribute__((unused)),
/* get arg(s) */
/* default: set replication basedn */
- if ((dn = fetch_attr(e, "basedn", (char
*)slapi_sdn_get_dn(posix_winsync_config_get_suffix()))) == NULL) {
+ if ((dn = slapi_fetch_attr(e, "basedn", (char
*)slapi_sdn_get_dn(posix_winsync_config_get_suffix()))) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -75,7 +75,7 @@ posix_group_task_add(Slapi_PBlock *pb __attribute__((unused)),
slapi_log_err(SLAPI_LOG_PLUGIN, POSIX_WINSYNC_PLUGIN_NAME,
"posix_group_task_add: retrieved basedn: %s\n", dn);
- if ((filter = fetch_attr(e, "filter",
"(&(objectclass=ntGroup)(|(uniquemember=*)(memberuid=*)))")) == NULL) {
+ if ((filter = slapi_fetch_attr(e, "filter",
"(&(objectclass=ntGroup)(|(uniquemember=*)(memberuid=*)))")) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c
b/ldap/servers/plugins/replication/repl5_replica_config.c
index 5d846a9..eb5e5a4 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -1386,7 +1386,7 @@ replica_cleanall_ruv_task(Slapi_PBlock *pb __attribute__((unused)),
/*
* Get our task settings
*/
- if ((rid_str = fetch_attr(e, "replica-id", 0)) == NULL) {
+ if ((rid_str = slapi_fetch_attr(e, "replica-id", 0)) == NULL) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Missing replica-id
attribute");
cleanruv_log(task, -1, CLEANALLRUV_ID, SLAPI_LOG_ERR, "%s",
returntext);
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
@@ -1394,14 +1394,14 @@ replica_cleanall_ruv_task(Slapi_PBlock *pb
__attribute__((unused)),
goto out;
}
rid = atoi(rid_str);
- if ((base_dn = fetch_attr(e, "replica-base-dn", 0)) == NULL) {
+ if ((base_dn = slapi_fetch_attr(e, "replica-base-dn", 0)) == NULL) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Missing replica-base-dn
attribute");
cleanruv_log(task, (int)rid, CLEANALLRUV_ID, SLAPI_LOG_ERR, "%s",
returntext);
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rc = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((force_cleaning = fetch_attr(e, "replica-force-cleaning", 0)) != NULL)
{
+ if ((force_cleaning = slapi_fetch_attr(e, "replica-force-cleaning", 0)) !=
NULL) {
if (strcasecmp(force_cleaning, "yes") != 0 &&
strcasecmp(force_cleaning, "no") != 0) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Invalid value for
replica-force-cleaning "
"(%s). Value must be
\"yes\" or \"no\" for task - (%s)",
@@ -2855,14 +2855,14 @@ replica_cleanall_ruv_abort(Slapi_PBlock *pb
__attribute__((unused)),
/*
* Get our task settings
*/
- if ((rid_str = fetch_attr(e, "replica-id", 0)) == NULL) {
+ if ((rid_str = slapi_fetch_attr(e, "replica-id", 0)) == NULL) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Missing required attr
\"replica-id\"");
cleanruv_log(task, -1, ABORT_CLEANALLRUV_ID, SLAPI_LOG_ERR, "%s",
returntext);
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rc = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- certify_all = fetch_attr(e, "replica-certify-all", 0);
+ certify_all = slapi_fetch_attr(e, "replica-certify-all", 0);
/*
* Check the rid
*/
@@ -2875,7 +2875,7 @@ replica_cleanall_ruv_abort(Slapi_PBlock *pb
__attribute__((unused)),
rc = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((base_dn = fetch_attr(e, "replica-base-dn", 0)) == NULL) {
+ if ((base_dn = slapi_fetch_attr(e, "replica-base-dn", 0)) == NULL) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "Missing required attr
\"replica-base-dn\"");
cleanruv_log(task, rid, ABORT_CLEANALLRUV_ID, SLAPI_LOG_ERR, "%s",
returntext);
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c
b/ldap/servers/plugins/replication/windows_protocol_util.c
index f6898d0..e354372 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -764,7 +764,7 @@ send_password_modify(Slapi_DN *sdn,
/* Get the local entry if it exists */
rc = windows_get_local_entry(local_sdn, &local_entry);
if ((0 == rc) && local_entry) {
- expiration_val = (char *)fetch_attr(local_entry,
"passwordExpirationtime", NULL);
+ expiration_val = (char *)slapi_fetch_attr(local_entry,
"passwordExpirationtime", NULL);
if (expiration_val &&
parse_genTime(expiration_val) != NO_TIME){
/* The user did reset their password */
slapi_log_err(SLAPI_LOG_REPL,
windows_repl_plugin_name,
diff --git a/ldap/servers/plugins/schema_reload/schema_reload.c
b/ldap/servers/plugins/schema_reload/schema_reload.c
index c2399e5..00b7821 100644
--- a/ldap/servers/plugins/schema_reload/schema_reload.c
+++ b/ldap/servers/plugins/schema_reload/schema_reload.c
@@ -226,7 +226,7 @@ schemareload_add(Slapi_PBlock *pb,
char *bind_dn;
*returncode = LDAP_SUCCESS;
- if (fetch_attr(e, "cn", NULL) == NULL) {
+ if (slapi_fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -236,7 +236,7 @@ schemareload_add(Slapi_PBlock *pb,
slapi_pblock_get(pb, SLAPI_REQUESTOR_DN, &bind_dn);
/* get arg(s) */
- schemadir = fetch_attr(e, "schemadir", NULL);
+ schemadir = slapi_fetch_attr(e, "schemadir", NULL);
/* allocate new task now */
task = slapi_plugin_new_task(slapi_entry_get_ndn(e), arg);
diff --git a/ldap/servers/plugins/syntaxes/validate_task.c
b/ldap/servers/plugins/syntaxes/validate_task.c
index afec9ef..d069a33 100644
--- a/ldap/servers/plugins/syntaxes/validate_task.c
+++ b/ldap/servers/plugins/syntaxes/validate_task.c
@@ -94,13 +94,13 @@ syntax_validate_task_add(Slapi_PBlock *pb __attribute__((unused)),
*returncode = LDAP_SUCCESS;
/* get arg(s) */
- if ((dn = fetch_attr(e, "basedn", 0)) == NULL) {
+ if ((dn = slapi_fetch_attr(e, "basedn", 0)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((filter = fetch_attr(e, "filter", "(objectclass=*)")) ==
NULL) {
+ if ((filter = slapi_fetch_attr(e, "filter", "(objectclass=*)"))
== NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 467e783..4bf2268 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -8277,7 +8277,7 @@ int32_t slapi_atomic_decr_32(int32_t *ptr, int memorder);
uint64_t slapi_atomic_decr_64(uint64_t *ptr, int memorder);
/* helper function */
-const char * fetch_attr(Slapi_Entry *e, const char *attrname, char *default_val);
+const char * slapi_fetch_attr(Slapi_Entry *e, const char *attrname, char *default_val);
#ifdef __cplusplus
}
diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c
index 91b51d9..b145176 100644
--- a/ldap/servers/slapd/task.c
+++ b/ldap/servers/slapd/task.c
@@ -380,7 +380,7 @@ slapi_task_status_changed(Slapi_Task *task)
e = get_internal_entry(pb, task->task_dn);
if (e == NULL)
return;
- ttl = atoi(fetch_attr(e, "ttl", DEFAULT_TTL));
+ ttl = atoi(slapi_fetch_attr(e, "ttl", DEFAULT_TTL));
if (ttl > 3600)
ttl = 3600; /* be reasonable. */
expire = time(NULL) + ttl;
@@ -842,14 +842,14 @@ task_modify(Slapi_PBlock *pb,
/* okay, we've decided to accept these changes. now look at the new
* entry and absorb any new values.
*/
- if (strcasecmp(fetch_attr(eAfter, "nsTaskCancel", "false"),
"true") == 0) {
+ if (strcasecmp(slapi_fetch_attr(eAfter, "nsTaskCancel", "false"),
"true") == 0) {
/* cancel this task, if not already */
if (task->task_state != SLAPI_TASK_CANCELLED) {
task->task_state = SLAPI_TASK_CANCELLED;
if (task->cancel) {
(*task->cancel)(task);
slapi_log_err(SLAPI_LOG_INFO, "task_modify", "Canceling
task '%s'\n",
- fetch_attr(eAfter, "cn", "?"));
+ slapi_fetch_attr(eAfter, "cn", "?"));
}
}
}
@@ -879,13 +879,13 @@ task_import_add(Slapi_PBlock *pb __attribute__((unused)),
char *nameFrombe_name = NULL;
const char *encrypt_on_import = NULL;
- if (fetch_attr(e, "cn", NULL) == NULL) {
+ if (slapi_fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
return SLAPI_DSE_CALLBACK_ERROR;
}
- instance_name = fetch_attr(e, "nsInstance", NULL);
+ instance_name = slapi_fetch_attr(e, "nsInstance", NULL);
- encrypt_on_import = fetch_attr(e, "nsImportEncrypt", NULL);
+ encrypt_on_import = slapi_fetch_attr(e, "nsImportEncrypt", NULL);
/* include/exclude suffixes */
if (slapi_entry_attr_find(e, "nsIncludeSuffix", &attr) == 0) {
@@ -998,8 +998,8 @@ task_import_add(Slapi_PBlock *pb __attribute__((unused)),
charray_add(&ldif_file, slapi_ch_strdup(slapi_value_get_string(val)));
}
- do_attr_indexes = fetch_attr(e, "nsImportIndexAttrs", "true");
- uniqueid_kind_str = fetch_attr(e, "nsUniqueIdGenerator", NULL);
+ do_attr_indexes = slapi_fetch_attr(e, "nsImportIndexAttrs",
"true");
+ uniqueid_kind_str = slapi_fetch_attr(e, "nsUniqueIdGenerator", NULL);
if (uniqueid_kind_str != NULL) {
if (strcasecmp(uniqueid_kind_str, "none") == 0) {
uniqueid_kind = SLAPI_UNIQUEID_GENERATE_NONE;
@@ -1024,7 +1024,7 @@ task_import_add(Slapi_PBlock *pb __attribute__((unused)),
slapi_pblock_set(mypb, SLAPI_BACKEND, be);
slapi_pblock_set(mypb, SLAPI_PLUGIN, be->be_database);
- int32_t removedupvals = atoi(fetch_attr(e, "nsImportChunkSize",
"0"));
+ int32_t removedupvals = atoi(slapi_fetch_attr(e, "nsImportChunkSize",
"0"));
slapi_pblock_set(mypb, SLAPI_LDIF2DB_REMOVEDUPVALS, &removedupvals);
int32_t noattrindexes = !(strcasecmp(do_attr_indexes, "true") == 0);
@@ -1032,7 +1032,7 @@ task_import_add(Slapi_PBlock *pb __attribute__((unused)),
slapi_pblock_set(mypb, SLAPI_LDIF2DB_GENERATE_UNIQUEID, &uniqueid_kind);
- char *namespaceid = (char *)fetch_attr(e, "nsUniqueIdGeneratorNamespace",
NULL);
+ char *namespaceid = (char *)slapi_fetch_attr(e,
"nsUniqueIdGeneratorNamespace", NULL);
slapi_pblock_set(mypb, SLAPI_LDIF2DB_NAMESPACEID, namespaceid);
slapi_pblock_set(mypb, SLAPI_BACKEND_INSTANCE_NAME, (void *)instance_name);
@@ -1220,13 +1220,13 @@ task_export_add(Slapi_PBlock *pb __attribute__((unused)),
const char *decrypt_on_export = NULL;
*returncode = LDAP_SUCCESS;
- if (fetch_attr(e, "cn", NULL) == NULL) {
+ if (slapi_fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- decrypt_on_export = fetch_attr(e, "nsExportDecrypt", NULL);
+ decrypt_on_export = slapi_fetch_attr(e, "nsExportDecrypt", NULL);
/* nsInstances -- from here on, memory has been allocated */
if (slapi_entry_attr_find(e, "nsInstance", &attr) == 0) {
@@ -1298,50 +1298,50 @@ task_export_add(Slapi_PBlock *pb __attribute__((unused)),
}
/* ldif file name */
- if ((my_ldif_file = fetch_attr(e, "nsFilename", NULL)) == NULL) {
+ if ((my_ldif_file = slapi_fetch_attr(e, "nsFilename", NULL)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
ldif_file = slapi_ch_strdup(my_ldif_file);
/* if true, multiple backends are dumped into one ldif file */
- use_one_file = fetch_attr(e, "nsUseOneFile", "true");
+ use_one_file = slapi_fetch_attr(e, "nsUseOneFile", "true");
if (strcasecmp(use_one_file, "true") == 0) {
ldif_printkey_flag |= EXPORT_APPENDMODE;
}
/* -r: export replica */
- export_replica = fetch_attr(e, "nsExportReplica", "false");
+ export_replica = slapi_fetch_attr(e, "nsExportReplica",
"false");
if (!strcasecmp(export_replica, "true")) /* true */
export_replica_flag = 1;
/* -N: eq "false" ==> does not print out key value */
- ldif_printkey = fetch_attr(e, "nsPrintKey", "true");
+ ldif_printkey = slapi_fetch_attr(e, "nsPrintKey", "true");
if (!strcasecmp(ldif_printkey, "true")) /* true */
ldif_printkey_flag |= EXPORT_PRINTKEY;
/* -C: eq "true" ==> use only id2entry file */
- ldif_printkey = fetch_attr(e, "nsUseId2Entry", "false");
+ ldif_printkey = slapi_fetch_attr(e, "nsUseId2Entry", "false");
if (!strcasecmp(ldif_printkey, "true")) /* true */
ldif_printkey_flag |= EXPORT_ID2ENTRY_ONLY;
/* if "true" ==> 8-bit strings are not base64 encoded */
- ldif_printkey = fetch_attr(e, "nsMinimalEncoding", "false");
+ ldif_printkey = slapi_fetch_attr(e, "nsMinimalEncoding",
"false");
if (!strcasecmp(ldif_printkey, "true")) /* true */
ldif_printkey_flag |= EXPORT_MINIMAL_ENCODING;
/* -U: eq "true" ==> does not fold the output */
- ldif_printkey = fetch_attr(e, "nsNoWrap", "false");
+ ldif_printkey = slapi_fetch_attr(e, "nsNoWrap", "false");
if (!strcasecmp(ldif_printkey, "true")) /* true */
ldif_printkey_flag |= EXPORT_NOWRAP;
/* -1: eq "true" ==> does not print version line */
- ldif_printkey = fetch_attr(e, "nsNoVersionLine", "false");
+ ldif_printkey = slapi_fetch_attr(e, "nsNoVersionLine", "false");
if (!strcasecmp(ldif_printkey, "true")) /* true */
ldif_printkey_flag |= EXPORT_NOVERSION;
/* -u: eq "false" ==> does not dump unique id */
- dump_uniqueid = fetch_attr(e, "nsDumpUniqId", "true");
+ dump_uniqueid = slapi_fetch_attr(e, "nsDumpUniqId", "true");
if (!strcasecmp(dump_uniqueid, "true")) /* true */
dump_uniqueid_flag = 1;
@@ -1500,21 +1500,21 @@ task_backup_add(Slapi_PBlock *pb __attribute__((unused)),
Slapi_Task *task = NULL;
*returncode = LDAP_SUCCESS;
- if (fetch_attr(e, "cn", NULL) == NULL) {
+ if (slapi_fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
/* archive dir name */
- if ((archive_dir = fetch_attr(e, "nsArchiveDir", NULL)) == NULL) {
+ if ((archive_dir = slapi_fetch_attr(e, "nsArchiveDir", NULL)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
/* database type */
- my_database_type = fetch_attr(e, "nsDatabaseType", NULL);
+ my_database_type = slapi_fetch_attr(e, "nsDatabaseType", NULL);
if (NULL != my_database_type)
database_type = my_database_type;
@@ -1657,25 +1657,25 @@ task_restore_add(Slapi_PBlock *pb,
PRThread *thread = NULL;
*returncode = LDAP_SUCCESS;
- if (fetch_attr(e, "cn", NULL) == NULL) {
+ if (slapi_fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
/* archive dir name */
- if ((archive_dir = fetch_attr(e, "nsArchiveDir", NULL)) == NULL) {
+ if ((archive_dir = slapi_fetch_attr(e, "nsArchiveDir", NULL)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
/* database type */
- my_database_type = fetch_attr(e, "nsDatabaseType", NULL);
+ my_database_type = slapi_fetch_attr(e, "nsDatabaseType", NULL);
if (NULL != my_database_type)
database_type = my_database_type;
- instance_name = fetch_attr(e, "nsInstance", NULL);
+ instance_name = slapi_fetch_attr(e, "nsInstance", NULL);
/* get backend that has archive2db and the database type matches. */
be = slapi_get_first_backend(&cookie);
@@ -1814,12 +1814,12 @@ task_index_add(Slapi_PBlock *pb __attribute__((unused)),
PRThread *thread = NULL;
*returncode = LDAP_SUCCESS;
- if (fetch_attr(e, "cn", NULL) == NULL) {
+ if (slapi_fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
- if ((instance_name = fetch_attr(e, "nsInstance", NULL)) == NULL) {
+ if ((instance_name = slapi_fetch_attr(e, "nsInstance", NULL)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -1942,26 +1942,26 @@ task_upgradedb_add(Slapi_PBlock *pb __attribute__((unused)),
char *cookie = NULL;
*returncode = LDAP_SUCCESS;
- if (fetch_attr(e, "cn", NULL) == NULL) {
+ if (slapi_fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
/* archive dir name */
- if ((archive_dir = fetch_attr(e, "nsArchiveDir", NULL)) == NULL) {
+ if ((archive_dir = slapi_fetch_attr(e, "nsArchiveDir", NULL)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
/* database type */
- my_database_type = fetch_attr(e, "nsDatabaseType", NULL);
+ my_database_type = slapi_fetch_attr(e, "nsDatabaseType", NULL);
if (NULL != my_database_type)
database_type = my_database_type;
/* force to reindex? */
- force = fetch_attr(e, "nsForceToReindex", NULL);
+ force = slapi_fetch_attr(e, "nsForceToReindex", NULL);
/* get backend that has db2archive and the database type matches. */
be = slapi_get_first_backend(&cookie);
diff --git a/ldap/servers/slapd/test-plugins/sampletask.c
b/ldap/servers/slapd/test-plugins/sampletask.c
index 22d43dd..772b224 100644
--- a/ldap/servers/slapd/test-plugins/sampletask.c
+++ b/ldap/servers/slapd/test-plugins/sampletask.c
@@ -143,14 +143,14 @@ task_sampletask_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry
*eAfter, int *
const char *myarg;
*returncode = LDAP_SUCCESS;
- if ((cn = fetch_attr(e, "cn", NULL)) == NULL) {
+ if ((cn = slapi_fetch_attr(e, "cn", NULL)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
}
/* get arg(s) */
- if ((myarg = fetch_attr(e, "myarg", NULL)) == NULL) {
+ if ((myarg = slapi_fetch_attr(e, "myarg", NULL)) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index acf9784..1cfdd21 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -1614,7 +1614,7 @@ get_internal_conn_op (uint64_t *connid, int32_t *op_id, int32_t
*op_internal_id,
* to free the returned string value.
*/
const char *
-fetch_attr(Slapi_Entry *e, const char *attrname, char *default_val)
+slapi_fetch_attr(Slapi_Entry *e, const char *attrname, char *default_val)
{
Slapi_Attr *attr;
Slapi_Value *val = NULL;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.