[Fedora-directory-commits] ldapserver/ldap/admin/src cfg_sspt.c, 1.12, 1.13 addindex.c, 1.7, NONE ds_bak2db.c, 1.5, NONE ds_db2bak.c, 1.6, NONE ds_db2ldif.c, 1.5, NONE ds_ldif2db.c, 1.7, NONE ds_listdb.c, 1.5, NONE ds_remove.c, 1.8, NONE ds_rmdb.c, 1.7, NONE ds_snmpctrl.c, 1.6, NONE restart.c, 1.5, NONE shutdown.c, 1.5, NONE start.c, 1.6, NONE vlvindex.c, 1.5, NONE
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9522
Modified Files:
cfg_sspt.c
Removed Files:
addindex.c ds_bak2db.c ds_db2bak.c ds_db2ldif.c ds_ldif2db.c
ds_listdb.c ds_remove.c ds_rmdb.c ds_snmpctrl.c restart.c
shutdown.c start.c vlvindex.c
Log Message:
Resolves: #237356
Summary: Move DS Admin Code into Admin Server (Comment #54)
Description:
1) eliminated the code adding o=netscaperoot related entries from cfg_sspt.c.
2) moving DS task CGIs to the adminserver.
Index: cfg_sspt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/cfg_sspt.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- cfg_sspt.c 7 Jun 2007 22:40:14 -0000 1.12
+++ cfg_sspt.c 13 Jun 2007 01:26:58 -0000 1.13
@@ -93,14 +93,11 @@
char* const name_st = "st";
char* const name_l = "l";
-char* const value_configAdminGroupCN = "Configuration Administrators";
-char* const value_configAdminGroupRDN = "cn=Configuration Administrators";
-char* const value_configAdminCN = "Configuration Administrator";
-char* const value_configAdminSN = "Administrator";
-char* const value_configAdminGN = "Configuration";
-char* const value_globalPreferencesOU = "Global Preferences";
-char* const value_hostPreferencesOU = "Host Preferences";
-char* const value_netscapeConfigDesc = "Standard branch for configuration information";
+char* const name_netscaperootDN = "o=NetscapeRoot";
+
+char* const value_configAdminCN = "Configuration Administrator";
+char* const value_configAdminSN = "Administrator";
+char* const value_configAdminGN = "Configuration";
char* const value_peopleOU = "People";
char* const value_peopleDesc = "Standard branch for people (uid) entries";
char* const value_groupsOU = "Groups";
@@ -112,14 +109,6 @@
char* dbg_log_file = "ds_sscfg.log";
-char* const name_netscaperoot = "NetscapeRoot";
-char* const name_netscaperootDN = "o=NetscapeRoot";
-char* const name_topology = "TopologyManagement";
-char* const name_topologyRDN = "ou=TopologyManagement";
-char* const value_topologyDESC = "Branch for Configuration Administration users and groups";
-char* const name_administratorsOU = "Administrators";
-char* const name_administratorsRDN = "ou=Administrators";
-char* const value_administratorsDESC = "Standard branch for Configuration Administrator (uid) entries";
char* const name_localDAGroup = "Directory Administrators";
char* const value_localDAGroupDesc = "Entities with administrative access to this directory server";
@@ -994,70 +983,6 @@
return ret;
}
-static int
-create_NetscapeRoot(LDAP* ld, const char *DN)
-{
-/*
- dn: o=NetscapeRoot
- o: NetscapeRoot
- objectclass: top
- objectclass: organization
- */
- int err;
- int ret = 0;
-
-#ifdef CGI_DEBUG
- debug_log (dbg_log_file, "create_NetscapeRoot()\n");
-#endif
-
- if (ld == NULL)
- {
- return -1;
- }
-
- if (!entry_exists(ld, DN))
- {
- LDAPMod* attrs[4];
- LDAPMod attr[3];
- char* objectClasses[4];
- char* names[2];
-
- attrs[0] = &attr[0];
- attrs[3] = NULL;
- attr[0].mod_op = LDAP_MOD_ADD;
- attr[0].mod_type = name_objectClass;
- attr[0].mod_values = objectClasses;
- objectClasses[0] = class_top;
- objectClasses[1] = class_organization;
- objectClasses[2] = NULL;
- attrs[1] = &attr[1];
- attr[1].mod_op = LDAP_MOD_ADD;
- attr[1].mod_type = name_o;
- attr[1].mod_values = names;
- names[0] = name_netscaperoot;
- names[1] = NULL;
- attrs[2] = NULL;
-
- /* fprintf (stdout, "ldap_add_s(%s)<br>\n", DN); fflush (stdout); */
-
- err = ldap_add_s (ld, DN, attrs);
-
- if (err != LDAP_SUCCESS)
- {
- char* explanation = PR_smprintf("Unable to create %s."
- " (%s (%i) returned from ldap_add_s(%s))",
- name_netscaperoot, ldap_err2string (err), err,
- DN);
- ds_report_warning (DS_NETWORK_ERROR, " can't create NetscapeRoot",
- explanation);
- PR_smprintf_free (explanation);
- ret = 1;
- }
-
- }
-
- return ret;
-}
#ifdef TEST_CONFIG
static int
@@ -1405,28 +1330,6 @@
if (!(connection = do_bind (slapd, query->rootDN, query->rootPW)))
return 1;
- /* parent dn of admin uid entry */
- if (query->netscaperoot) {
- parentDN = make_dn("%s, %s, %s", name_administratorsRDN,
- name_topologyRDN, query->netscaperoot, NULLSTR);
- }
-
- if (query->config_admin_uid) {
- getUIDFromDN(query->config_admin_uid, realuid);
- if (realuid[0]) {
- /* admid is already a DN */
- configAdminDN = strdup(query->config_admin_uid);
- } else if (parentDN) {
- /* create a DN for admid */
- configAdminDN = make_dn(DN_formatUID, query->config_admin_uid, parentDN, NULLSTR);
- } else {
- /* create one from scratch */
- configAdminDN = make_dn("%s=%s, %s, %s, %s", name_uid, query->config_admin_uid,
- name_administratorsRDN, name_topologyRDN,
- name_netscaperootDN, NULLSTR);
- }
- }
-
if (query->suffix)
{
status = create_base(connection, query->suffix);
@@ -1448,16 +1351,6 @@
if (!status)
{
- /*
- Give the Configuration Admin group access to the root DSE entries
- */
- if (query->netscaperoot) {
- adminGroupDN = make_dn("%s, %s=%s, %s, %s", value_configAdminGroupRDN,
- name_ou, value_groupsOU,
- name_topologyRDN,
- query->netscaperoot, NULLSTR);
- }
-
if (query->suffix)
{
localDAGroupDN = make_dn("cn=%s, %s", name_localDAGroup,
@@ -1491,114 +1384,6 @@
}
}
- if (query->cfg_sspt)
- {
- /* create and set ACIs for o=netscaperoot entry */
- if (!status)
- status = create_NetscapeRoot(connection, query->netscaperoot);
-
- if (!status)
- status = add_aci_v(connection, query->netscaperoot,
- ACI_config_admin_group_allow_all,
- value_configAdminGroupRDN,
- name_ou, value_groupsOU, name_topologyRDN,
- query->netscaperoot, NULLSTR);
-
- if (!status)
- status = add_aci_v(connection, query->netscaperoot,
- ACI_anonymous_allow_with_filter,
- query->netscaperoot, NULLSTR);
-
- if (!status)
- status = add_aci_v(connection, query->netscaperoot, ACI_group_expansion,
- query->netscaperoot, NULLSTR);
-
- /* create "topologyOU, netscaperoot" entry and set ACIs */
- if (!status)
- {
- char *dn = make_dn("%s, %s", name_topologyRDN,
- query->netscaperoot, NULLSTR);
- status = create_organizational_unit(connection, NULL, dn,
- value_topologyDESC,
- 0, 0, 0);
-
- if (!status)
- add_aci(connection, dn, ACI_anonymous_allow);
-
- free(dn);
- }
-
- /* create "ou=Groups, ..." */
- if (!status)
- {
- char *dn = make_dn("%s=%s, %s, %s", name_ou, value_groupsOU,
- name_topologyRDN, query->netscaperoot, NULLSTR);
- status = create_organizational_unit (connection, NULL, dn,
- value_groupsDesc, 0, 0, 0);
- free(dn);
- }
-
- /* create "ou=Administrators, ..." */
- if (!status)
- {
- char *dn = make_dn("%s, %s, %s", name_administratorsRDN,
- name_topologyRDN, query->netscaperoot, NULLSTR);
- status = create_organizational_unit (connection, NULL, dn,
- value_administratorsDESC,
- 0, 0, 0);
- free(dn);
- }
-
- /* create "cn=Configuration Administrators, ou=Groups, ..." */
- if (!status)
- {
- char *dn = make_dn("%s=%s, %s, %s", name_ou, value_groupsOU,
- name_topologyRDN,
- query->netscaperoot, NULLSTR);
- status = create_group (connection, dn, value_configAdminGroupCN);
- free(dn);
- }
-
- /* create the ss admin user */
- if (!status && !is_root_user(query->ssAdmID, query))
- {
- /* group to add the uid to */
- char *groupdn = make_dn("%s, %s=%s, %s, %s", value_configAdminGroupRDN,
- name_ou, value_groupsOU, name_topologyRDN,
- query->netscaperoot, NULLSTR);
- create_ssadmin_user(connection, parentDN,
- query->ssAdmID, query->ssAdmPW1);
-
- status = add_group_member (connection, groupdn,
- name_uniqueMember, configAdminDN);
- free (groupdn);
- }
-
- admin_domainDN = make_dn("%s=%s, %s", name_ou, query->admin_domain,
- query->netscaperoot, NULLSTR);
-
- if (!status)
- status = create_organizational_unit (connection, 0,
- admin_domainDN,
- value_netscapeConfigDesc,
- class_adminDomain,
- name_adminDomain,
- query->admin_domain);
-
- if (!status) {
- status = create_organizational_unit(connection,
- admin_domainDN,
- value_globalPreferencesOU, 0,
- 0, 0, 0);
- }
- if (!status) {
- status = create_organizational_unit(connection,
- admin_domainDN,
- value_hostPreferencesOU, 0,
- 0, 0, 0);
- }
- }
-
#ifdef TEST_CONFIG
if (!status && query->testconfig)
status = create_configEntry(connection);
--- addindex.c DELETED ---
--- ds_bak2db.c DELETED ---
--- ds_db2bak.c DELETED ---
--- ds_db2ldif.c DELETED ---
--- ds_ldif2db.c DELETED ---
--- ds_listdb.c DELETED ---
--- ds_remove.c DELETED ---
--- ds_rmdb.c DELETED ---
--- ds_snmpctrl.c DELETED ---
--- restart.c DELETED ---
--- shutdown.c DELETED ---
--- start.c DELETED ---
--- vlvindex.c DELETED ---
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/libraries/libutil Makefile, 1.7, NONE getopt.c, 1.2, NONE ntdebug.c, 1.6, NONE ntevent.c, 1.7, NONE ntreg.c, 1.5, NONE ntresource.h, 1.5, NONE ntstubs.c, 1.6, NONE
by Doctor Conrad
Author: nkinder
Update of /cvs/dirsec/ldapserver/ldap/libraries/libutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8501
Removed Files:
Makefile getopt.c ntdebug.c ntevent.c ntreg.c ntresource.h
ntstubs.c
Log Message:
Summary: Removed unused source files.
--- Makefile DELETED ---
--- getopt.c DELETED ---
--- ntdebug.c DELETED ---
--- ntevent.c DELETED ---
--- ntreg.c DELETED ---
--- ntresource.h DELETED ---
--- ntstubs.c DELETED ---
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts Dialog.pm, 1.1, 1.2 Setup.pm.in, 1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30745/ldapserver/ldap/admin/src/scripts
Modified Files:
Dialog.pm Setup.pm.in
Log Message:
Resolves: bug 237356
Description: Move DS Admin Code into Admin Server
Fix Description: 1) Need to have $SILENT be greater than $CUSTOM so that dialog hiding works properly.
2) Need to have the ability to hide or show individual prompts in a dialog e.g. if using TLS/SSL, need to ask for the CA certificate filename, otherwise, not.
3) Need the ability to call a function to get the default yes or no answer for DialogYesNo
4) DialogYesNo should match answer case insensitively
Index: Dialog.pm
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Dialog.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Dialog.pm 8 Jun 2007 01:09:16 -0000 1.1
+++ Dialog.pm 12 Jun 2007 21:08:20 -0000 1.2
@@ -107,12 +107,18 @@
}
# each prompt looks like this:
-# [ 'resource key', is pwd ]
+# [ 'resource key', is pwd, hide ]
# The resource key is the string key of the resource
# is pwd is optional - if present, the prompt is for a password
# and should not echo the answer
+# hide is optional - if present and true, the prompt will not be displayed - this
+# is useful in cases where you may want to display or hide a subprompt depending
+# on the response to a main prompt
# e.g.
# ['RESOURCE_USERNAME'], ['RESOURCE_PASSWORD', 1], ['RESOURCE_PASSWORD_AGAIN', 1]
+# e.g.
+# ['USE_SECURITY'], ['CA_CERTIFICATE', 0, 0]
+# you can set the 0 to a 1 if the user has chosen to use security
sub run {
my $self = shift;
my $resp = $DialogManager::SAME;
@@ -129,7 +135,7 @@
my $prompt = $prompts[$index];
my $defaultans = $self->{defaultAns}($self, $index);
my $ans;
- if ($self->isDisplayed()) {
+ if ($self->isDisplayed() && !$promtpt->[2]) {
$ans = $self->{manager}->showPrompt($prompt->[0], $defaultans, $prompt->[1]);
} else {
$ans = $defaultans;
@@ -201,7 +207,13 @@
return $self->{ans};
}
if (!exists($self->{default})) {
- if ($self->{defaultIsYes}) {
+ my $isyes;
+ if (ref($self->{defaultIsYes}) eq 'CODE') {
+ $isyes = &{$self->{defaultIsYes}}($self);
+ } else {
+ $isyes = $self->{defaultIsYes};
+ }
+ if ($isyes) {
$self->{default} = $self->{"manager"}->getText("yes");
} else {
$self->{default} = $self->{"manager"}->getText("no");
@@ -223,10 +235,10 @@
my $nno = $self->{"manager"}->getText("no");
# the regexp allows us to use y or ye or yes for "yes"
- if ($nno =~ /^$ans/) {
+ if ($nno =~ /^$ans/i) {
$resp = $DialogManager::NEXT;
$self->{ans} = $nno;
- } elsif ($yes =~ /^$ans/) {
+ } elsif ($yes =~ /^$ans/i) {
$resp = $DialogManager::NEXT;
$self->{ans} = $yes;
} else {
Index: Setup.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Setup.pm.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Setup.pm.in 8 Jun 2007 01:09:16 -0000 1.1
+++ Setup.pm.in 12 Jun 2007 21:08:20 -0000 1.2
@@ -71,10 +71,10 @@
use SetupLog;
# the setup types
-$SILENT = 0;
$EXPRESS = 1;
$TYPICAL = 2;
$CUSTOM = 3;
+$SILENT = 4;
# process command line options
Getopt::Long::Configure(qw(bundling)); # bundling allows -ddddd
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/include ldif.h,1.5,NONE
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/include
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11857/ldap/include
Removed Files:
ldif.h
Log Message:
Resolves: #243488
Summary: Use mozldap6 ldif_parse_line API
Changes:
1) Removed ldif.h from the DS tree.
2) Eliminated the 5-th arg of ldif_parse_line (errmsg) and the errmsg related
code.
--- ldif.h DELETED ---
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm import-threads.c, 1.12, 1.13
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11857/ldap/servers/slapd/back-ldbm
Modified Files:
import-threads.c
Log Message:
Resolves: #243488
Summary: Use mozldap6 ldif_parse_line API
Changes:
1) Removed ldif.h from the DS tree.
2) Eliminated the 5-th arg of ldif_parse_line (errmsg) and the errmsg related
code.
Index: import-threads.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/import-threads.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- import-threads.c 10 Nov 2006 23:45:39 -0000 1.12
+++ import-threads.c 11 Jun 2007 17:22:38 -0000 1.13
@@ -283,21 +283,16 @@
offset = s - str;
mystr = ms = slapi_ch_strdup(str);
while ( (s = ldif_getline( &ms )) != NULL ) {
- char *errmsg = NULL;
- if ( (retmalloc = ldif_parse_line( s, &type, &valuecharptr, &valuelen, &errmsg )) >= 0 ) {
+ if ( (retmalloc = ldif_parse_line( s, &type, &valuecharptr, &valuelen )) >= 0 ) {
if (!strcasecmp(type, "version")) {
my_version = atoi(valuecharptr);
*(str + offset) = '#';
/* the memory below was not allocated by the slapi_ch_ functions */
- if (errmsg) PR_smprintf_free(errmsg);
if (retmalloc) slapi_ch_free((void **) &valuecharptr);
break;
}
- } else if ( errmsg != NULL ) {
- LDAPDebug( LDAP_DEBUG_PARSE, "%s", errmsg, 0, 0 );
}
/* the memory below was not allocated by the slapi_ch_ functions */
- if (errmsg) slapi_ch_free((void **) &errmsg);
if (retmalloc) slapi_ch_free((void **) &valuecharptr);
}
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd entry.c, 1.12, 1.13 fedse.c, 1.9, 1.10
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11857/ldap/servers/slapd
Modified Files:
entry.c fedse.c
Log Message:
Resolves: #243488
Summary: Use mozldap6 ldif_parse_line API
Changes:
1) Removed ldif.h from the DS tree.
2) Eliminated the 5-th arg of ldif_parse_line (errmsg) and the errmsg related
code.
Index: entry.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/entry.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- entry.c 10 Nov 2006 23:45:40 -0000 1.12
+++ entry.c 11 Jun 2007 17:22:37 -0000 1.13
@@ -203,27 +203,17 @@
int maxvals;
int del_maxvals;
char *type;
- char *errmsg = NULL;
if ( *s == '\n' || *s == '\0' ) {
break;
}
- if ( (retmalloc = ldif_parse_line( s, &type, &valuecharptr, &valuelen, &errmsg )) < 0 ) {
- if ( errmsg != NULL ) {
- LDAPDebug( LDAP_DEBUG_PARSE, "%s", errmsg, 0, 0 );
- /* the memory below was not allocated by the slapi_ch_ functions */
- PR_smprintf_free(errmsg );
- }
+ if ( (retmalloc = ldif_parse_line( s, &type, &valuecharptr, &valuelen )) < 0 ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"<= str2entry_fast NULL (parse_line)\n", 0, 0, 0 );
continue;
}
- /* We don't use errmsg anywhere later. free it to avoid leaking... */
- /* the memory below was not allocated by the slapi_ch_ functions */
- slapi_ch_free( (void**)&errmsg );
-
/*
* Extract the attribute and value CSNs from the attribute type.
*/
@@ -581,7 +571,6 @@
int i, j;
char *next=NULL;
char *valuecharptr=NULL;
- char *errmsg = NULL;
int retmalloc = 0;
int rc;
int fast_dup_check = 0;
@@ -617,21 +606,12 @@
break;
}
- if ( (retmalloc = ldif_parse_line( s, &type, &valuecharptr, &valuelen, &errmsg )) < 0 ) {
- if ( errmsg != NULL ) {
- LDAPDebug( LDAP_DEBUG_PARSE, "%s", errmsg, 0, 0 );
- /* the memory below was not allocated by the slapi_ch_ functions */
- PR_smprintf_free(errmsg );
- }
+ if ( (retmalloc = ldif_parse_line( s, &type, &valuecharptr, &valuelen )) < 0 ) {
LDAPDebug( LDAP_DEBUG_TRACE,
"<= slapi_str2entry NULL (parse_line)\n", 0, 0, 0 );
continue;
}
- /* We don't use errmsg anywhere later. free it to avoid leaking... */
- /* the memory below was not allocated by the slapi_ch_ functions */
- slapi_ch_free( (void**)&errmsg );
-
/*
* Extract the attribute and value CSNs from the attribute type.
*/
Index: fedse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/fedse.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- fedse.c 10 Nov 2006 23:45:40 -0000 1.9
+++ fedse.c 11 Jun 2007 17:22:37 -0000 1.10
@@ -1735,7 +1735,6 @@
{
static int twiddle= -1;
char *type, *value, *copy;
- char *errmsg = NULL;
int vlen;
struct berval bv;
struct berval *bvals[2];
@@ -1745,12 +1744,7 @@
bvals[0] = &bv;
bvals[1] = NULL;
copy= slapi_ch_strdup(easter_egg_photos[twiddle%NUM_EASTER_EGG_PHOTOS]);
- if ( (retmalloc = ldif_parse_line(copy, &type, &value, &vlen, &errmsg)) < 0 ) {
- if ( errmsg != NULL ) {
- slapi_log_error( SLAPI_LOG_PARSE, "dse", "%s", errmsg );
- /* the memory below was not allocated by the slapi_ch_ functions */
- PR_smprintf_free(errmsg );
- }
+ if ( (retmalloc = ldif_parse_line(copy, &type, &value, &vlen)) < 0 ) {
return SLAPI_DSE_CALLBACK_ERROR;
}
bv.bv_val = value;
@@ -1760,7 +1754,6 @@
slapi_ch_free((void**)©);
twiddle++;
/* the memory below was not allocated by the slapi_ch_ functions */
- slapi_ch_free( (void**)&errmsg );
if (retmalloc) slapi_ch_free( (void**)&value );
return SLAPI_DSE_CALLBACK_OK;
}
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication cl5_api.c, 1.14, 1.15 replutil.c, 1.9, 1.10
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11857/ldap/servers/plugins/replication
Modified Files:
cl5_api.c replutil.c
Log Message:
Resolves: #243488
Summary: Use mozldap6 ldif_parse_line API
Changes:
1) Removed ldif.h from the DS tree.
2) Eliminated the 5-th arg of ldif_parse_line (errmsg) and the errmsg related
code.
Index: cl5_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- cl5_api.c 15 Mar 2007 21:40:34 -0000 1.14
+++ cl5_api.c 11 Jun 2007 17:22:37 -0000 1.15
@@ -4988,21 +4988,15 @@
next = ldifEntry;
while ((line = ldif_getline(&next)) != NULL)
{
- char *errmsg = NULL;
-
if ( *line == '\n' || *line == '\0' )
{
break;
}
/* this call modifies ldifEntry */
- rc = ldif_parse_line(line, &type, &value, &vlen, &errmsg);
+ rc = ldif_parse_line(line, &type, &value, &vlen);
if (rc != 0)
{
- if ( errmsg != NULL ) {
- slapi_log_error(SLAPI_LOG_PARSE, repl_plugin_name_cl, "%s", errmsg);
- PR_smprintf_free(errmsg );
- }
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
"_cl5LDIF2Operation: warning - failed to parse ldif line\n");
continue;
Index: replutil.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/replutil.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- replutil.c 10 Nov 2006 23:45:17 -0000 1.9
+++ replutil.c 11 Jun 2007 17:22:37 -0000 1.10
@@ -428,8 +428,6 @@
slapi_mod_init (&mod, 0);
while (line)
{
- char * errmsg = NULL;
-
if (strcasecmp (line, "-") == 0)
{
if (slapi_mod_isvalid (&mod))
@@ -446,14 +444,10 @@
break;
}
- rc = ldif_parse_line(line, &type, &value, &vlen, &errmsg);
+ rc = ldif_parse_line(line, &type, &value, &vlen);
if (rc != 0)
{
/* ONREPL - log warning */
- if ( errmsg != NULL ) {
- slapi_log_error( SLAPI_LOG_PARSE, repl_plugin_name, "%s", errmsg );
- PR_smprintf_free(errmsg );
- }
slapi_log_error( SLAPI_LOG_REPL, repl_plugin_name,
"Failed to parse the ldif line.\n");
continue;
16 years, 9 months
[Fedora-directory-commits] ldapserver/ldap/admin/lib dsalib_confs.c, 1.7, 1.8
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/lib
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11857/ldap/admin/lib
Modified Files:
dsalib_confs.c
Log Message:
Resolves: #243488
Summary: Use mozldap6 ldif_parse_line API
Changes:
1) Removed ldif.h from the DS tree.
2) Eliminated the 5-th arg of ldif_parse_line (errmsg) and the errmsg related
code.
Index: dsalib_confs.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/lib/dsalib_confs.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- dsalib_confs.c 10 Nov 2006 23:44:32 -0000 1.7
+++ dsalib_confs.c 11 Jun 2007 17:22:37 -0000 1.8
@@ -78,22 +78,16 @@
char *type, *value;
int vlen = 0;
int rc;
- char *errmsg = NULL;
if ( *line == '\n' || *line == '\0' ) {
break;
}
/* this call modifies line */
- rc = ldif_parse_line(line, &type, &value, &vlen, &errmsg);
+ rc = ldif_parse_line(line, &type, &value, &vlen);
if (rc != 0)
{
- if ( errmsg != NULL ) {
- ds_send_error(errmsg, 0);
- PR_smprintf_free(errmsg);
- } else {
ds_send_error("Unknown error processing config file", 0);
- }
free(begin);
return NULL;
}
@@ -160,7 +154,7 @@
* Use ldif_parse_line() so continuation markers are
* handled correctly, etc.
*/
- char *errmsg, *type = NULL, *value = NULL, *tmpvalue = NULL;
+ char *type = NULL, *value = NULL, *tmpvalue = NULL;
int ldif_rc, tmpvlen = 0;
char *tmpline = strdup(line);
@@ -171,19 +165,15 @@
return(NULL);
}
- ldif_rc = ldif_parse_line( tmpline, &type, &tmpvalue,
- &tmpvlen, &errmsg );
+ ldif_rc = ldif_parse_line( tmpline, &type, &tmpvalue, &tmpvlen );
if (ldif_rc < 0) {
- ds_send_error(errmsg, 0 /* do not print errno */);
+ ds_send_error("Unknown error processing config file", 0);
} else if (ldif_rc == 0) { /* value returned in place */
value = strdup(tmpvalue);
} else { /* malloc'd value */
value = tmpvalue;
}
free(tmpline);
- if (errmsg) {
- PR_smprintf_free(errmsg);
- }
return value;
}
}
16 years, 9 months