[Fedora-directory-commits] ldapserver/ldap/admin/src logconv.pl, 1.6, 1.7
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18538
Modified Files:
logconv.pl
Log Message:
Resolves: #403751
Summary: command line scripts fine tuning (Comment #2)
Description: removed words "6.x" and "iWS" from the output messages.
Index: logconv.pl
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/logconv.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- logconv.pl 18 Apr 2006 18:57:44 -0000 1.6
+++ logconv.pl 6 Dec 2007 02:46:17 -0000 1.7
@@ -365,7 +365,6 @@
print "Deletes: $delete\n";
print "Mod RDNs: $modrdn\n";
print "\n";
-print "6.x Stats \n";
print "Persistent Searches: $persistent\n";
print "Internal Operations: $internal\n";
print "Entry Operations: $entryOp\n";
@@ -802,16 +801,16 @@
}
-###############################################
-# #
-# Gather and process extended operations 6.x #
-# #
-###############################################
+##########################################
+# #
+# Gather and process extended operations #
+# #
+##########################################
if ($usage =~ /x/i || $verb eq "yes"){
if ($extendedop > 0){
-print "\n\n----- 6.x Extended Operations -----\n\n";
+print "\n\n----- Extended Operations -----\n\n";
foreach $oids (sort { $oid{$b} <=> $oid{$a} } (keys %oid) ){
if ($oids eq "2.16.840.1.113730.3.5.1"){ $oidmessage = "Transaction Request"}
@@ -824,7 +823,7 @@
elsif ($oids eq "2.16.840.1.113730.3.5.8"){ $oidmessage = "Finished Bulk Import"}
elsif ($oids eq "2.16.840.1.113730.3.6.1"){ $oidmessage = "Incremental Update Replication Protocol"}
elsif ($oids eq "2.16.840.1.113730.3.6.2"){ $oidmessage = "Total Update Replication Protocol (Initialization)"}
- elsif ($oids eq "2.16.840.1.113730.3.5.9"){ $oidmessage = "Digest Authentication (iWS 6.x)"}
+ elsif ($oids eq "2.16.840.1.113730.3.5.9"){ $oidmessage = "Digest Authentication"}
else {$oidmessage = "Other"}
printf "%-6s %-23s %-60s\n", $oid{ $oids }, $oids, $oidmessage;
16 years, 3 months
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts template-db2index.pl.in, 1.4, 1.5
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18494
Modified Files:
template-db2index.pl.in
Log Message:
Resolves: #403751
Summary: command line scripts fine tuning (Comment #1)
Description: dded "-T vlvAttributeName: ..." to the usage
Index: template-db2index.pl.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2index.pl.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- template-db2index.pl.in 12 Feb 2007 19:55:10 -0000 1.4
+++ template-db2index.pl.in 6 Dec 2007 02:45:20 -0000 1.5
@@ -42,19 +42,20 @@
sub usage {
print(STDERR "Usage: $0 [-v] -D rootdn { -w password | -w - | -j filename } \n");
print(STDERR " -n instance [-t attributeName[:indextypes[:matchingrules]]]\n");
- print(STDERR " Opts: -D rootdn - Directory Manager\n");
- print(STDERR " : -w password - Directory Manager's password\n");
- print(STDERR " : -w - - Prompt for Directory Manager's password\n");
- print(STDERR " : -j filename - Read Directory Manager's password from file\n");
- print(STDERR " : -n instance - instance to be indexed\n");
+ print(STDERR " Opts: -D rootdn - Directory Manager\n");
+ print(STDERR " : -w password - Directory Manager's password\n");
+ print(STDERR " : -w - - Prompt for Directory Manager's password\n");
+ print(STDERR " : -j filename - Read Directory Manager's password from file\n");
+ print(STDERR " : -n instance - instance to be indexed\n");
print(STDERR " : -t attributeName[:indextypes[:matchingrules]]\n");
- print(STDERR " - attribute: name of the attribute to be indexed\n");
- print(STDERR " If omitted, all the indexes defined \n");
- print(STDERR " for that instance are generated.\n");
- print(STDERR " - indextypes: comma separated index types\n");
- print(STDERR " - matchingrules: comma separated matrules\n");
- print(STDERR " Example: -t foo:eq,pres\n");
- print(STDERR " : -v - verbose\n");
+ print(STDERR " - attributeName: name of the attribute to be indexed\n");
+ print(STDERR " If omitted, all the indexes defined \n");
+ print(STDERR " for that instance are generated.\n");
+ print(STDERR " - indextypes: comma separated index types\n");
+ print(STDERR " - matchingrules: comma separated matrules\n");
+ print(STDERR " Example: -t foo:eq,pres\n");
+ print(STDERR " : -T vlvAttributeName - vlvAttributeName: name of the vlv attribute to be indexed\n");
+ print(STDERR " : -v - verbose\n");
}
$instance = "";
16 years, 3 months
[Fedora-directory-commits] admservconsole/src/com/netscape/management/admserv/panel CGIAccessSetup.java, 1.2, 1.3 CGIDataModel.java, 1.1.1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/admservconsole/src/com/netscape/management/admserv/panel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4566/admservconsole/src/com/netscape/management/admserv/panel
Modified Files:
CGIAccessSetup.java CGIDataModel.java
Log Message:
Resolves: bug 400361
Bug Description: Console: can't perform admin tasks after changing password
Reviewed by: nhosoi (Thanks!)
Fix Description: Each task uses a different ConsoleInfo object. There was already a hack/hook in AdminFrameworkInitializer to override the getAdminURL in each one of the task console info objects. We also need to override setAuthenticationPassword and getAuthenticationPassword so that if the task updates the password, the main console info uses that change, and vice versa. I also added a couple of debug items.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: CGIAccessSetup.java
===================================================================
RCS file: /cvs/dirsec/admservconsole/src/com/netscape/management/admserv/panel/CGIAccessSetup.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CGIAccessSetup.java 15 Jun 2006 17:02:33 -0000 1.2
+++ CGIAccessSetup.java 5 Dec 2007 19:54:23 -0000 1.3
@@ -74,7 +74,7 @@
_consoleInfo.getAuthenticationDN(),
_consoleInfo.getAuthenticationPassword());
} catch (MalformedURLException e) {
- Debug.println("CGIDataModel.setConfiguration "+e);
+ Debug.println("CGIAccessSetup.save: "+e);
throw new RemoteRequestException(e);
}
@@ -85,7 +85,6 @@
}
int status = task.getStatus();
- Debug.println(adminURL + " "+status);
AdminOperation.processAdmTaskStatus(adminURL, task,
_consoleInfo);
}
Index: CGIDataModel.java
===================================================================
RCS file: /cvs/dirsec/admservconsole/src/com/netscape/management/admserv/panel/CGIDataModel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CGIDataModel.java 22 May 2006 18:14:41 -0000 1.1.1.1
+++ CGIDataModel.java 5 Dec 2007 19:54:23 -0000 1.2
@@ -258,7 +258,8 @@
int status = task.getStatus();
_loaded = (status == 0);
- Debug.println(adminURL + " "+status);
+ Debug.println("CGIDataModel.getConfiguration(): called URL " +
+ adminURL + " "+status);
AdminOperation.processAdmTaskStatus(adminURL, task, _consoleInfo);
16 years, 3 months
[Fedora-directory-commits] admservconsole/src/com/netscape/management/admserv AdminFrameworkInitializer.java, 1.1.1.1, 1.2
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/admservconsole/src/com/netscape/management/admserv
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4566/admservconsole/src/com/netscape/management/admserv
Modified Files:
AdminFrameworkInitializer.java
Log Message:
Resolves: bug 400361
Bug Description: Console: can't perform admin tasks after changing password
Reviewed by: nhosoi (Thanks!)
Fix Description: Each task uses a different ConsoleInfo object. There was already a hack/hook in AdminFrameworkInitializer to override the getAdminURL in each one of the task console info objects. We also need to override setAuthenticationPassword and getAuthenticationPassword so that if the task updates the password, the main console info uses that change, and vice versa. I also added a couple of debug items.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
Index: AdminFrameworkInitializer.java
===================================================================
RCS file: /cvs/dirsec/admservconsole/src/com/netscape/management/admserv/AdminFrameworkInitializer.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- AdminFrameworkInitializer.java 22 May 2006 18:14:32 -0000 1.1.1.1
+++ AdminFrameworkInitializer.java 5 Dec 2007 19:54:22 -0000 1.2
@@ -109,6 +109,19 @@
public String getAdminURL() {
return serverNodeConsoleInfo.getAdminURL();
}
+ /* We have to make sure we use the same password throughout
+ * for the main console and for the tasks - if we do not do
+ * this and we change the password, the tasks will use the
+ * wrong password. This way, if we change the password from
+ * either the Configure task, or from the Configuration tab,
+ * we will use the same password throughout.
+ */
+ public void setAuthenticationPassword(String password) {
+ serverNodeConsoleInfo.setAuthenticationPassword(password);
+ }
+ public String getAuthenticationPassword() {
+ return serverNodeConsoleInfo.getAuthenticationPassword();
+ }
};
private void removeTask(TaskObject root, String taskName) {
16 years, 3 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm archive.c, 1.14, 1.15
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22611
Modified Files:
archive.c
Log Message:
Resolves: #174776
Summary: Multiple restores from a non-existant directory could wipe out database
Description: The given archive path was not normalized. Due to the trailing
slash '/', comparing with the db dir failed and wiped out the db dirs.
Applying the path normalization to the archive path.
Index: archive.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/archive.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- archive.c 8 Oct 2007 18:45:00 -0000 1.14
+++ archive.c 4 Dec 2007 17:52:56 -0000 1.15
@@ -47,7 +47,8 @@
int ldbm_back_archive2ldbm( Slapi_PBlock *pb )
{
struct ldbminfo *li;
- char *directory = NULL; /* -a <directory> */
+ char *rawdirectory = NULL; /* -a <directory> */
+ char *directory = NULL; /* normalized */
char *backendname = NULL;
int return_value = -1;
int task_flags = 0;
@@ -56,18 +57,20 @@
int is_old_to_new = 0;
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
- slapi_pblock_get( pb, SLAPI_SEQ_VAL, &directory );
+ slapi_pblock_get( pb, SLAPI_SEQ_VAL, &rawdirectory );
slapi_pblock_get( pb, SLAPI_BACKEND_INSTANCE_NAME, &backendname);
slapi_pblock_get( pb, SLAPI_BACKEND_TASK, &task );
slapi_pblock_get( pb, SLAPI_TASK_FLAGS, &task_flags );
li->li_flags = run_from_cmdline = (task_flags & TASK_RUNNING_FROM_COMMANDLINE);
- if ( !directory || !*directory ) {
+ if ( !rawdirectory || !*rawdirectory ) {
LDAPDebug( LDAP_DEBUG_ANY, "archive2db: no archive name\n",
0, 0, 0 );
return( -1 );
}
+ directory = rel2abspath(rawdirectory);
+
/* check the current idl format vs backup DB version */
if (idl_get_idl_new())
{
@@ -251,6 +254,7 @@
}
}
out:
+ slapi_ch_free_string(&directory);
return return_value;
}
16 years, 3 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm ldbm_config.h, 1.6, 1.7 ldbm_instance_config.c, 1.9, 1.10 ldbm_config.c, 1.13, 1.14 dblayer.c, 1.25, 1.26 start.c, 1.7, 1.8
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29527
Modified Files:
ldbm_config.h ldbm_instance_config.c ldbm_config.c dblayer.c
start.c
Log Message:
Resolves: #231093
Summary: db2bak: crash bug (comment #8, 11)
Description:
Set the strong requirement: nsslapd-directory must have some value.
to guarantee it:
1) checking errors from ldbm_config_directory_set. If the check fails, don't
start the server.
2) if nsslapd-directory does not exist or the value is empty in dse.ldif,
issuing an error message and returning the error code.
3) since it was difficult to distinguish the nsslapd-directory empty value from
the initial default value, introduced CONFIG_FLAG_SKIP_DEFAULT_SETTING flag to
tell the backend config code to skip setting the default value
Index: ldbm_config.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ldbm_config.h 10 Nov 2006 23:45:39 -0000 1.6
+++ ldbm_config.h 4 Dec 2007 00:50:19 -0000 1.7
@@ -72,6 +72,7 @@
#define CONFIG_FLAG_PREVIOUSLY_SET 1
#define CONFIG_FLAG_ALWAYS_SHOW 2
#define CONFIG_FLAG_ALLOW_RUNNING_CHANGE 4
+#define CONFIG_FLAG_SKIP_DEFAULT_SETTING 8
struct config_info {
char *config_name;
Index: ldbm_instance_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ldbm_instance_config.c 14 Nov 2007 15:04:51 -0000 1.9
+++ ldbm_instance_config.c 4 Dec 2007 00:50:19 -0000 1.10
@@ -480,8 +480,12 @@
0, 0, 0);
return 1;
}
- parse_ldbm_instance_config_entry(inst, entries[0],
- ldbm_instance_config);
+ if (0 != parse_ldbm_instance_config_entry(inst, entries[0],
+ ldbm_instance_config)) {
+ LDAPDebug(LDAP_DEBUG_ANY, "Error parsing the config DSE\n",
+ 0, 0, 0);
+ return 1;
+ }
}
if (search_pb)
Index: ldbm_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ldbm_config.c 28 Nov 2007 19:03:42 -0000 1.13
+++ ldbm_config.c 4 Dec 2007 00:50:19 -0000 1.14
@@ -243,75 +243,86 @@
strdup'ed in rel2abspath */
LDAPDebug(LDAP_DEBUG_ANY, "New db directory location will not take affect until the server is restarted\n", 0, 0, 0);
} else {
- if (!strcmp(val, "get default")) {
- /* We use this funky "get default" string for the caller to
- * tell us that it has no idea what the db directory should
- * be. This code figures it out be reading "cn=config,cn=ldbm
- * database,cn=plugins,cn=config" entry. */
- Slapi_PBlock *search_pb;
- Slapi_Entry **entries = NULL;
- Slapi_Attr *attr = NULL;
- Slapi_Value *v = NULL;
- const char *s = NULL;
- int res;
-
- search_pb = slapi_pblock_new();
- slapi_search_internal_set_pb(search_pb, CONFIG_LDBM_DN,
- LDAP_SCOPE_BASE, "objectclass=*", NULL, 0, NULL, NULL,
- li->li_identity, 0);
- slapi_search_internal_pb(search_pb);
- slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
-
- if (res != LDAP_SUCCESS) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "ERROR: ldbm plugin unable to read %s\n",
- CONFIG_LDBM_DN, 0, 0);
- goto done;
- }
-
- slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
- if (NULL == entries) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "ERROR: ldbm plugin unable to read %s\n",
- CONFIG_LDBM_DN, 0, 0);
- res = LDAP_OPERATIONS_ERROR;
- goto done;
- }
-
- res = slapi_entry_attr_find(entries[0], "nsslapd-directory", &attr);
- if (res != 0 || attr == NULL) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "ERROR: ldbm plugin unable to read attribute nsslapd-directory from %s\n",
- CONFIG_LDBM_DN, 0, 0);
- res = LDAP_OPERATIONS_ERROR;
- goto done;
- }
-
- if ( slapi_attr_first_value(attr,&v) != 0
- || ( NULL == v )
- || ( NULL == ( s = slapi_value_get_string( v )))) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "ERROR: ldbm plugin unable to read attribute nsslapd-directory from %s\n",
- CONFIG_LDBM_DN, 0, 0);
- res = LDAP_OPERATIONS_ERROR;
- goto done;
- }
-
-done:
- slapi_pblock_destroy(search_pb);
- if (res != LDAP_SUCCESS) {
- return res;
- }
- PR_snprintf(tmpbuf, BUFSIZ, "%s", s);
- val = tmpbuf;
- }
slapi_ch_free((void **) &(li->li_new_directory));
slapi_ch_free((void **) &(li->li_directory));
- li->li_new_directory = rel2abspath(val); /* normalize the path;
- strdup'ed in rel2abspath */
- li->li_directory = rel2abspath(val); /* ditto */
+ if (NULL == val || '\0' == *val) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: db directory is not set; check %s in the db config: %s\n",
+ CONFIG_DIRECTORY, CONFIG_LDBM_DN, 0);
+ retval = LDAP_PARAM_ERROR;
+ } else {
+ if (0 == strcmp(val, "get default")) {
+ /* We use this funky "get default" string for the caller to
+ * tell us that it has no idea what the db directory should
+ * be. This code figures it out be reading "cn=config,cn=ldbm
+ * database,cn=plugins,cn=config" entry. */
+ Slapi_PBlock *search_pb;
+ Slapi_Entry **entries = NULL;
+ Slapi_Attr *attr = NULL;
+ Slapi_Value *v = NULL;
+ const char *s = NULL;
+ int res;
+
+ search_pb = slapi_pblock_new();
+ slapi_search_internal_set_pb(search_pb, CONFIG_LDBM_DN,
+ LDAP_SCOPE_BASE, "objectclass=*", NULL, 0, NULL, NULL,
+ li->li_identity, 0);
+ slapi_search_internal_pb(search_pb);
+ slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
+
+ if (res != LDAP_SUCCESS) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: ldbm plugin unable to read %s\n",
+ CONFIG_LDBM_DN, 0, 0);
+ retval = res;
+ goto done;
+ }
+
+ slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
+ if (NULL == entries) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: ldbm plugin unable to read %s\n",
+ CONFIG_LDBM_DN, 0, 0);
+ retval = LDAP_OPERATIONS_ERROR;
+ goto done;
+ }
+
+ res = slapi_entry_attr_find(entries[0], "nsslapd-directory", &attr);
+ if (res != 0 || attr == NULL) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: ldbm plugin unable to read attribute nsslapd-directory from %s\n",
+ CONFIG_LDBM_DN, 0, 0);
+ retval = LDAP_OPERATIONS_ERROR;
+ goto done;
+ }
+
+ if ( slapi_attr_first_value(attr,&v) != 0
+ || ( NULL == v )
+ || ( NULL == ( s = slapi_value_get_string( v )))) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: ldbm plugin unable to read attribute nsslapd-directory from %s\n",
+ CONFIG_LDBM_DN, 0, 0);
+ retval = LDAP_OPERATIONS_ERROR;
+ goto done;
+ }
+ slapi_pblock_destroy(search_pb);
+ if (NULL == s || '\0' == s || 0 == PL_strcmp(s, "(null)")) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: db directory is not set; check %s in the db config: %s\n",
+ CONFIG_DIRECTORY, CONFIG_LDBM_DN, 0);
+ retval = LDAP_PARAM_ERROR;
+ goto done;
+ }
+ PR_snprintf(tmpbuf, BUFSIZ, "%s", s);
+ val = tmpbuf;
+ }
+ li->li_new_directory = rel2abspath(val); /* normalize the path;
+ strdup'ed in
+ rel2abspath */
+ li->li_directory = rel2abspath(val); /* ditto */
+ }
}
-
+done:
return retval;
}
@@ -1193,7 +1204,7 @@
{CONFIG_LOOKTHROUGHLIMIT, CONFIG_TYPE_INT, "5000", &ldbm_config_lookthroughlimit_get, &ldbm_config_lookthroughlimit_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_MODE, CONFIG_TYPE_INT_OCTAL, "0600", &ldbm_config_mode_get, &ldbm_config_mode_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_IDLISTSCANLIMIT, CONFIG_TYPE_INT, "4000", &ldbm_config_allidsthreshold_get, &ldbm_config_allidsthreshold_set, CONFIG_FLAG_ALWAYS_SHOW},
- {CONFIG_DIRECTORY, CONFIG_TYPE_STRING, "", &ldbm_config_directory_get, &ldbm_config_directory_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
+ {CONFIG_DIRECTORY, CONFIG_TYPE_STRING, "", &ldbm_config_directory_get, &ldbm_config_directory_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE|CONFIG_FLAG_SKIP_DEFAULT_SETTING},
{CONFIG_DBCACHESIZE, CONFIG_TYPE_SIZE_T, "10000000", &ldbm_config_dbcachesize_get, &ldbm_config_dbcachesize_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_DBNCACHE, CONFIG_TYPE_INT, "0", &ldbm_config_dbncache_get, &ldbm_config_dbncache_set, CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
{CONFIG_MAXPASSBEFOREMERGE, CONFIG_TYPE_INT, "100", &ldbm_config_maxpassbeforemerge_get, &ldbm_config_maxpassbeforemerge_set, 0},
@@ -1319,7 +1330,11 @@
0, 0, 0);
return 1;
}
- parse_ldbm_config_entry(li, entries[0], ldbm_config);
+ if (0 != parse_ldbm_config_entry(li, entries[0], ldbm_config)) {
+ LDAPDebug(LDAP_DEBUG_ANY, "Error parsing the ldbm config DSE\n",
+ 0, 0, 0);
+ return 1;
+ }
}
if (search_pb) {
@@ -1520,6 +1535,9 @@
/* If the config phase is initialization or if bval is NULL, we will use
* the default value for the attribute. */
if (CONFIG_PHASE_INITIALIZATION == phase || NULL == bval) {
+ if (CONFIG_FLAG_SKIP_DEFAULT_SETTING & config->config_flags) {
+ return LDAP_SUCCESS; /* Skipping the default config setting */
+ }
use_default = 1;
} else {
use_default = 0;
Index: dblayer.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- dblayer.c 18 Oct 2007 00:08:34 -0000 1.25
+++ dblayer.c 4 Dec 2007 00:50:19 -0000 1.26
@@ -1409,6 +1409,11 @@
/* DBDB we should pick these up in our config routine, and do away with
* the li_ one */
+ if (NULL == li->li_directory || '\0' == *li->li_directory) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "Error: DB directory is not specified.\n", 0, 0, 0);
+ return -1;
+ }
PR_Lock(li->li_config_mutex);
priv->dblayer_home_directory = li->li_directory; /* nsslapd-directory */
priv->dblayer_cachesize = li->li_dbcachesize;
Index: start.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/start.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- start.c 15 Mar 2007 21:34:32 -0000 1.7
+++ start.c 4 Dec 2007 00:50:19 -0000 1.8
@@ -63,7 +63,11 @@
slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
/* parse the config file here */
- ldbm_config_load_dse_info(li);
+ if (0 != ldbm_config_load_dse_info(li)) {
+ LDAPDebug( LDAP_DEBUG_ANY, "start: Loading database configuration failed\n",
+ 0, 0, 0 );
+ return SLAPI_FAIL_GENERAL;
+ }
/* register with the binder-based resource limit subsystem so that */
/* lookthroughlimit can be supported on a per-connection basis. */
@@ -77,7 +81,7 @@
/* If the db directory hasn't been set yet, we need to set it to
* the default. */
- if ('\0' == li->li_directory[0]) {
+ if (NULL == li->li_directory || '\0' == li->li_directory[0]) {
/* "get default" is a special string that tells the config
* routines to figure out the default db directory by
* reading cn=config. */
16 years, 4 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd log.c, 1.20, 1.21
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26331
Modified Files:
log.c
Log Message:
Resolves: #403351
Summary: LongDuration: Error log Rotation test suite causes slapd hang
Problem description: LDAPDebug eventually calls slapd_log_error_proc_internal,
which obtains the lock. If any functions called in the lock tries to log into
the errors log, it tries to get the same lock and it hangs there since the
underlying PR_Lock is not reentrant.
Fix description: log__enough_freespace and log__delete_error_logfile could be
called indirectly from slapd_log_error_proc_internal. Instead of LDAPDebug,
changed these functions to call log__error_emergency when necessary.
Index: log.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/log.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- log.c 23 Oct 2007 16:13:58 -0000 1.20
+++ log.c 3 Dec 2007 18:16:32 -0000 1.21
@@ -116,7 +116,7 @@
static int log__open_auditlogfile(int logfile_type, int locked);
static int log__needrotation(LOGFD fp, int logtype);
static int log__delete_access_logfile();
-static int log__delete_error_logfile();
+static int log__delete_error_logfile(int locked);
static int log__delete_audit_logfile();
static int log__access_rotationinfof(char *pathname);
static int log__error_rotationinfof(char *pathname);
@@ -2926,10 +2926,14 @@
if (statvfs(path, &buf) == -1)
#endif
{
- int oserr = errno;
- LDAPDebug(LDAP_DEBUG_ANY,
- "log__enough_freespace: Unable to get the free space (errno:%d)\n",
- oserr,0,0);
+ char buffer[BUFSIZ];
+ PR_snprintf(buffer, sizeof(buffer),
+ "log__enough_freespace: Unable to get the free space (errno:%d)\n",
+ errno);
+ /* This function could be called in the ERROR WRITE LOCK,
+ * which causes the self deadlock if you call LDAPDebug for logging.
+ * Thus, instead of LDAPDebug, call log__error_emergency with locked == 1. */
+ log__error_emergency(buffer, 0, 1);
return 1;
} else {
LL_UI2L(freeBytes, buf.f_bavail);
@@ -3024,7 +3028,7 @@
******************************************************************************/
static int
-log__delete_error_logfile()
+log__delete_error_logfile(int locked)
{
struct logfileinfo *logp = NULL;
@@ -3044,18 +3048,27 @@
/* If we have only one log, then will delete this one */
if (loginfo.log_error_maxnumlogs == 1) {
LOG_CLOSE(loginfo.log_error_fdes);
- loginfo.log_error_fdes = NULL;
+ loginfo.log_error_fdes = NULL;
PR_snprintf (buffer, sizeof(buffer), "%s", loginfo.log_error_file);
if (PR_Delete(buffer) != PR_SUCCESS) {
- LDAPDebug(LDAP_DEBUG_TRACE,
- "LOGINFO:Unable to remove file:%s\n", loginfo.log_error_file,0,0);
+ if (!locked) {
+ /* if locked, we should not call LDAPDebug,
+ which tries to get a lock internally. */
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "LOGINFO:Unable to remove file:%s\n", loginfo.log_error_file,0,0);
+ }
}
/* Delete the rotation file also. */
PR_snprintf (buffer, sizeof(buffer), "%s.rotationinfo", loginfo.log_error_file);
if (PR_Delete(buffer) != PR_SUCCESS) {
- LDAPDebug(LDAP_DEBUG_TRACE,
- "LOGINFO:Unable to remove file:%s.rotationinfo\n", loginfo.log_error_file,0,0);
+ if (!locked) {
+ /* if locked, we should not call LDAPDebug,
+ which tries to get a lock internally. */
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "LOGINFO:Unable to remove file:%s.rotationinfo\n",
+ loginfo.log_error_file,0,0);
+ }
}
return 0;
}
@@ -3084,7 +3097,7 @@
}
/* If we have exceeded the max disk space or we have less than the
- ** minimum, then we have to delete a file.
+ ** minimum, then we have to delete a file.
*/
if (total_size >= loginfo.log_error_maxdiskspace) {
logstr = "exceeded maximum log disk space";
@@ -3145,10 +3158,14 @@
return 0;
}
}
- LDAPDebug(LDAP_DEBUG_TRACE,
+ if (!locked) {
+ /* if locked, we should not call LDAPDebug,
+ which tries to get a lock internally. */
+ LDAPDebug(LDAP_DEBUG_TRACE,
"LOGINFO:Removing file:%s.%s because of (%s)\n",
loginfo.log_error_file, tbuf,
logstr);
+ }
if (p_delete_logp == delete_logp) {
/* then we are deleteing the first one */
@@ -3161,8 +3178,12 @@
log_convert_time (delete_logp->l_ctime, tbuf, 1 /*short */);
PR_snprintf (buffer, sizeof(buffer), "%s.%s", loginfo.log_error_file, tbuf);
if (PR_Delete(buffer) != PR_SUCCESS) {
- LDAPDebug(LDAP_DEBUG_ANY, "LOGINFO:Unable to remove file:%s.%s\n",
- loginfo.log_audit_file, tbuf,0);
+ /* This function could be called in the ERROR WRITE LOCK,
+ * which causes the self deadlock if you call LDAPDebug for logging.
+ * Thus, instead of LDAPDebug, call log__error_emergency with locked == 1. */
+ PR_snprintf(buffer, sizeof(buffer), "LOGINFO:Unable to remove file:%s.%s\n",
+ loginfo.log_audit_file, tbuf);
+ log__error_emergency(buffer, 0, locked);
}
slapi_ch_free((void**)&delete_logp);
loginfo.log_numof_error_logs--;
@@ -3580,7 +3601,7 @@
/* Check if I have to delete any old file, delete it if it is required.*/
- while (log__delete_error_logfile());
+ while (log__delete_error_logfile(1));
/* close the file */
if ( loginfo.log_error_fdes != NULL ) {
16 years, 4 months