Branch '389-ds-base-1.2.8' - ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/mapping_tree.c | 10 +++++++++-
ldap/servers/slapd/opshared.c | 4 ++--
ldap/servers/slapd/slap.h | 2 +-
3 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit ef1cb3d053888274a8b7d0f59c8392427b01e783
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Mar 1 15:36:11 2011 -0700
Bug 680555 - ns-slapd segfaults if I have more than 100 DBs
https://bugzilla.redhat.com/show_bug.cgi?id=680555
Resolves: bug 680555
Bug Description: ns-slapd segfaults if I have more than 100 DBs
Reviewed by: nhosoi, nkinder (Thanks!)
Branch: 389-ds-base-1.2.8
Fix Description: 1) slapi_mapping_tree_select_all() does
be_list[BE_LIST_SIZE] = NULL
so be_list must be of size BE_LIST_SIZE+1
2) loop counter should check be_index, not index, to see if the loop is
completed
3) if the search is going to hit more backends than we can process, just
return ADMINLIMIT_EXCEEDED with an explanatory error message
4) increase the BE_LIST_SIZE to 1000
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 6c4eac9ca642b99d7664d3a6b04067c3091f5694)
diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c
index 0f63560..898fe93 100644
--- a/ldap/servers/slapd/mapping_tree.c
+++ b/ldap/servers/slapd/mapping_tree.c
@@ -2178,7 +2178,7 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list,
ret = slapi_mtn_get_first_be(node_list, &node, pb, &be, &index, &referral, errorbuf, scope);
- while ((node) &&(index < BE_LIST_SIZE))
+ while ((node) && (be_index <= BE_LIST_SIZE))
{
if (ret != LDAP_SUCCESS)
{
@@ -2204,7 +2204,15 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list,
{
if (be && !be_isdeleted(be))
{
+ if (be_index == BE_LIST_SIZE) { /* error - too many backends */
+ ret_code = LDAP_ADMINLIMIT_EXCEEDED;
+ PR_snprintf(errorbuf, BUFSIZ-1,
+ "Error: too many backends match search request - cannot proceed");
+ slapi_log_error(SLAPI_LOG_FATAL, NULL, "%s\n", errorbuf);
+ break;
+ } else {
be_list[be_index++]=be;
+ }
}
if (referral)
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index b3e2c45..d398cd6 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -192,8 +192,8 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
int scope;
Slapi_Backend *be = NULL;
Slapi_Backend *be_single = NULL;
- Slapi_Backend *be_list[BE_LIST_SIZE];
- Slapi_Entry *referral_list[BE_LIST_SIZE];
+ Slapi_Backend *be_list[BE_LIST_SIZE+1];
+ Slapi_Entry *referral_list[BE_LIST_SIZE+1];
char ebuf[ BUFSIZ ];
char attrlistbuf[ 1024 ], *attrliststr, **attrs = NULL;
int rc = 0;
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index ee02a26..a19e5c8 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -299,7 +299,7 @@ typedef void (*VFP0)(void);
#define EGG_OBJECT_CLASS "directory-team-extensible-object"
#define EGG_FILTER "(objectclass=directory-team-extensible-object)"
-#define BE_LIST_SIZE 100 /* used by mapping tree code to hold be_list stuff */
+#define BE_LIST_SIZE 1000 /* used by mapping tree code to hold be_list stuff */
#define REPL_DBTYPE "ldbm"
#define REPL_DBTAG "repl"
13 years, 1 month
ldap/servers
by Richard Allen Megginson
ldap/servers/slapd/mapping_tree.c | 10 +++++++++-
ldap/servers/slapd/opshared.c | 4 ++--
ldap/servers/slapd/slap.h | 2 +-
3 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit 6c4eac9ca642b99d7664d3a6b04067c3091f5694
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Mar 1 15:36:11 2011 -0700
Bug 680555 - ns-slapd segfaults if I have more than 100 DBs
https://bugzilla.redhat.com/show_bug.cgi?id=680555
Resolves: bug 680555
Bug Description: ns-slapd segfaults if I have more than 100 DBs
Reviewed by: nhosoi, nkinder (Thanks!)
Branch: master
Fix Description: 1) slapi_mapping_tree_select_all() does
be_list[BE_LIST_SIZE] = NULL
so be_list must be of size BE_LIST_SIZE+1
2) loop counter should check be_index, not index, to see if the loop is
completed
3) if the search is going to hit more backends than we can process, just
return ADMINLIMIT_EXCEEDED with an explanatory error message
4) increase the BE_LIST_SIZE to 1000
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c
index 0f63560..898fe93 100644
--- a/ldap/servers/slapd/mapping_tree.c
+++ b/ldap/servers/slapd/mapping_tree.c
@@ -2178,7 +2178,7 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list,
ret = slapi_mtn_get_first_be(node_list, &node, pb, &be, &index, &referral, errorbuf, scope);
- while ((node) &&(index < BE_LIST_SIZE))
+ while ((node) && (be_index <= BE_LIST_SIZE))
{
if (ret != LDAP_SUCCESS)
{
@@ -2204,7 +2204,15 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list,
{
if (be && !be_isdeleted(be))
{
+ if (be_index == BE_LIST_SIZE) { /* error - too many backends */
+ ret_code = LDAP_ADMINLIMIT_EXCEEDED;
+ PR_snprintf(errorbuf, BUFSIZ-1,
+ "Error: too many backends match search request - cannot proceed");
+ slapi_log_error(SLAPI_LOG_FATAL, NULL, "%s\n", errorbuf);
+ break;
+ } else {
be_list[be_index++]=be;
+ }
}
if (referral)
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index b3e2c45..d398cd6 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -192,8 +192,8 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
int scope;
Slapi_Backend *be = NULL;
Slapi_Backend *be_single = NULL;
- Slapi_Backend *be_list[BE_LIST_SIZE];
- Slapi_Entry *referral_list[BE_LIST_SIZE];
+ Slapi_Backend *be_list[BE_LIST_SIZE+1];
+ Slapi_Entry *referral_list[BE_LIST_SIZE+1];
char ebuf[ BUFSIZ ];
char attrlistbuf[ 1024 ], *attrliststr, **attrs = NULL;
int rc = 0;
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index ee02a26..a19e5c8 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -299,7 +299,7 @@ typedef void (*VFP0)(void);
#define EGG_OBJECT_CLASS "directory-team-extensible-object"
#define EGG_FILTER "(objectclass=directory-team-extensible-object)"
-#define BE_LIST_SIZE 100 /* used by mapping tree code to hold be_list stuff */
+#define BE_LIST_SIZE 1000 /* used by mapping tree code to hold be_list stuff */
#define REPL_DBTYPE "ldbm"
#define REPL_DBTAG "repl"
13 years, 1 month
Branch '389-ds-base-1.2.8' - ldap/servers
by Nathan Kinder
ldap/servers/snmp/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 1ba8420cb8c46f5a11bfcb41650e2504c359ceea
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 1 13:44:45 2011 -0800
Bug 674852 - crash in ldap-agent when using OpenLDAP
The ldap-agent daemon can crash at startup due to an uninitialized
variable being used to represent a buffer length. This patch
initializes the buffer length properly.
diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c
index f4ca8af..a255880 100644
--- a/ldap/servers/snmp/main.c
+++ b/ldap/servers/snmp/main.c
@@ -248,7 +248,7 @@ load_config(char *conf_path)
FILE *conf_file = NULL;
#if defined(USE_OPENLDAP)
LDIFFP *dse_fp = NULL;
- int buflen;
+ int buflen = 0;
#else
FILE *dse_fp = NULL;
#endif
13 years, 1 month
Branch '389-ds-base-1.2.8' - ldap/admin
by Nathan Kinder
ldap/admin/src/scripts/DSCreate.pm.in | 10 ++++++++++
ldap/admin/src/scripts/DSUtil.pm.in | 33 +++++++++++++++++++++++++++++++--
2 files changed, 41 insertions(+), 2 deletions(-)
New commits:
commit a36c6df3732a13b2c09832136dd705a07b55d08f
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 1 13:30:19 2011 -0800
Bug 681345 - setup-ds.pl should set SuiteSpotGroup automatically
When the SuiteSpotGroup directive is not specified in the inf file
used by setup, the group permissions do not get set on certain
directories (such as the rundir). This can break instances if you
are running more than one on the same system.
This patch makes setup use the primary group of the SuiteSpot
user if the group is not specified. I also added validation of
the group parameter.
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in
index bda23a5..fcad74d 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -121,6 +121,10 @@ sub sanityCheckParams {
return @errs;
}
+ if (@errs = isValidGroup($inf->{General}->{SuiteSpotGroup})) {
+ return @errs;
+ }
+
if (!isValidDN($inf->{slapd}->{Suffix})) {
return ('dialog_dssuffix_error', $inf->{slapd}->{Suffix});
}
@@ -795,6 +799,12 @@ sub setDefaults {
# otherwise, the uid must be specified
}
+ if (!$inf->{General}->{SuiteSpotGroup}) {
+ # If the group wasn't specified, use the primary group
+ # of the SuiteSpot user
+ $inf->{General}->{SuiteSpotGroup} = getGroup($inf->{General}->{SuiteSpotUserID});
+ }
+
if (!$inf->{slapd}->{RootDN}) {
$inf->{slapd}->{RootDN} = "cn=Directory Manager";
}
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index 04d6f7b..e65f7e0 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -48,11 +48,13 @@ require Exporter;
@EXPORT = qw(portAvailable getAvailablePort isValidDN addSuffix getMappedEntries
process_maptbl check_and_add_entry getMappedEntries addErr
getHashedPassword debug createInfFromConfig shellEscape
- isValidServerID isValidUser makePaths getLogin remove_tree remove_pidfile);
+ isValidServerID isValidUser isValidGroup makePaths getLogin getGroup
+ remove_tree remove_pidfile);
@EXPORT_OK = qw(portAvailable getAvailablePort isValidDN addSuffix getMappedEntries
process_maptbl check_and_add_entry getMappedEntries addErr
getHashedPassword debug createInfFromConfig shellEscape
- isValidServerID isValidUser makePaths getLogin remove_tree remove_pidfile);
+ isValidServerID isValidUser isValidGroup makePaths getLogin getGroup
+ remove_tree remove_pidfile);
use strict;
@@ -124,6 +126,13 @@ sub getLogin {
return (getpwuid($>))[0] || $ENV{USER} || confess "Error: could not determine the current user ID: $!";
}
+# Look up the primary group name for the supplied user
+sub getGroup {
+ my $user = shift;
+ my $gid = (getpwnam($user))[3] || confess "Error: could not determine the current group ID: $!";
+ return (getgrgid($gid))[0] || confess "Error: could not determine the current group name: $!";
+}
+
sub isValidUser {
my $user = shift;
# convert numeric uid to string
@@ -152,6 +161,26 @@ sub isValidUser {
return ();
}
+sub isValidGroup {
+ my $group = shift;
+ my $ngid;
+ # convert numeric gid to string
+ my $strans = $group;
+ if ($group =~ /^\d+$/) { # numeric - convert to string
+ $strans = (getgrgid($group))[0];
+ if (!$strans) {
+ return ("dialog_ssgroup_error", $group);
+ }
+ }
+ # ensure the specified group is a defined group
+ $ngid = getgrnam $strans;
+ if (!defined($ngid)) {
+ return ("dialog_ssgroup_error", $group);
+ }
+
+ return ();
+}
+
# delete the subtree starting from the passed entry
sub delete_all
{
13 years, 1 month
ldap/admin
by Nathan Kinder
ldap/admin/src/scripts/DSCreate.pm.in | 10 ++++++++++
ldap/admin/src/scripts/DSUtil.pm.in | 33 +++++++++++++++++++++++++++++++--
2 files changed, 41 insertions(+), 2 deletions(-)
New commits:
commit e3c72d0a20a21c12db71f0ddf84717f428b24ac7
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 1 13:30:19 2011 -0800
Bug 681345 - setup-ds.pl should set SuiteSpotGroup automatically
When the SuiteSpotGroup directive is not specified in the inf file
used by setup, the group permissions do not get set on certain
directories (such as the rundir). This can break instances if you
are running more than one on the same system.
This patch makes setup use the primary group of the SuiteSpot
user if the group is not specified. I also added validation of
the group parameter.
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in
index bda23a5..fcad74d 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -121,6 +121,10 @@ sub sanityCheckParams {
return @errs;
}
+ if (@errs = isValidGroup($inf->{General}->{SuiteSpotGroup})) {
+ return @errs;
+ }
+
if (!isValidDN($inf->{slapd}->{Suffix})) {
return ('dialog_dssuffix_error', $inf->{slapd}->{Suffix});
}
@@ -795,6 +799,12 @@ sub setDefaults {
# otherwise, the uid must be specified
}
+ if (!$inf->{General}->{SuiteSpotGroup}) {
+ # If the group wasn't specified, use the primary group
+ # of the SuiteSpot user
+ $inf->{General}->{SuiteSpotGroup} = getGroup($inf->{General}->{SuiteSpotUserID});
+ }
+
if (!$inf->{slapd}->{RootDN}) {
$inf->{slapd}->{RootDN} = "cn=Directory Manager";
}
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index 04d6f7b..e65f7e0 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -48,11 +48,13 @@ require Exporter;
@EXPORT = qw(portAvailable getAvailablePort isValidDN addSuffix getMappedEntries
process_maptbl check_and_add_entry getMappedEntries addErr
getHashedPassword debug createInfFromConfig shellEscape
- isValidServerID isValidUser makePaths getLogin remove_tree remove_pidfile);
+ isValidServerID isValidUser isValidGroup makePaths getLogin getGroup
+ remove_tree remove_pidfile);
@EXPORT_OK = qw(portAvailable getAvailablePort isValidDN addSuffix getMappedEntries
process_maptbl check_and_add_entry getMappedEntries addErr
getHashedPassword debug createInfFromConfig shellEscape
- isValidServerID isValidUser makePaths getLogin remove_tree remove_pidfile);
+ isValidServerID isValidUser isValidGroup makePaths getLogin getGroup
+ remove_tree remove_pidfile);
use strict;
@@ -124,6 +126,13 @@ sub getLogin {
return (getpwuid($>))[0] || $ENV{USER} || confess "Error: could not determine the current user ID: $!";
}
+# Look up the primary group name for the supplied user
+sub getGroup {
+ my $user = shift;
+ my $gid = (getpwnam($user))[3] || confess "Error: could not determine the current group ID: $!";
+ return (getgrgid($gid))[0] || confess "Error: could not determine the current group name: $!";
+}
+
sub isValidUser {
my $user = shift;
# convert numeric uid to string
@@ -152,6 +161,26 @@ sub isValidUser {
return ();
}
+sub isValidGroup {
+ my $group = shift;
+ my $ngid;
+ # convert numeric gid to string
+ my $strans = $group;
+ if ($group =~ /^\d+$/) { # numeric - convert to string
+ $strans = (getgrgid($group))[0];
+ if (!$strans) {
+ return ("dialog_ssgroup_error", $group);
+ }
+ }
+ # ensure the specified group is a defined group
+ $ngid = getgrnam $strans;
+ if (!defined($ngid)) {
+ return ("dialog_ssgroup_error", $group);
+ }
+
+ return ();
+}
+
# delete the subtree starting from the passed entry
sub delete_all
{
13 years, 1 month
ldap/servers
by Nathan Kinder
ldap/servers/snmp/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 9b5d9e6dd001043f18259c5922b45020ea5e835f
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 1 13:44:45 2011 -0800
Bug 674852 - crash in ldap-agent when using OpenLDAP
The ldap-agent daemon can crash at startup due to an uninitialized
variable being used to represent a buffer length. This patch
initializes the buffer length properly.
diff --git a/ldap/servers/snmp/main.c b/ldap/servers/snmp/main.c
index f4ca8af..a255880 100644
--- a/ldap/servers/snmp/main.c
+++ b/ldap/servers/snmp/main.c
@@ -248,7 +248,7 @@ load_config(char *conf_path)
FILE *conf_file = NULL;
#if defined(USE_OPENLDAP)
LDIFFP *dse_fp = NULL;
- int buflen;
+ int buflen = 0;
#else
FILE *dse_fp = NULL;
#endif
13 years, 1 month
src/com
by Nathan Kinder
src/com/netscape/admin/dirserv/DSContentPage.java | 13 +++++++++++++
src/com/netscape/admin/dirserv/DSEntryDialog.java | 6 +++++-
2 files changed, 18 insertions(+), 1 deletion(-)
New commits:
commit 2ada9d096cfb80b8d9ca262d67b5e006b2c805a4
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 1 08:13:38 2011 -0800
Bug 229693 - Update naming attribute when objectclass is removed
When an entry is edited in Console using the advanced editor, one
can remove the objectclass that provides the naming attribute. If
the entry happens to be a user or group, the new naming attribute
is not passed to the Console Framework code, causing a non-existant
attribute to be used for the naming attribute. This will cause
operations to fail.
This patch makes the DS Console update the naming attribute properly
when objectclasses are removed.
diff --git a/src/com/netscape/admin/dirserv/DSContentPage.java b/src/com/netscape/admin/dirserv/DSContentPage.java
index ed1bde0..d00fb55 100644
--- a/src/com/netscape/admin/dirserv/DSContentPage.java
+++ b/src/com/netscape/admin/dirserv/DSContentPage.java
@@ -3590,9 +3590,22 @@ class UserGroupAdapter implements IResEditorAdvancedOpt {
if ( dlg != null ) {
/* Notify the observable from the kingpin editor */
LDAPModificationSet mods = dlg.getChanges();
+ String[] rdnAttrs = dlg.getNamingAttributes();
+
if ((mods != null) && (mods.size() > 0)) {
updateObservable( observableentry, mods );
}
+
+ // The naming attribute may have changed if any
+ // objectclasses were deleted. Update the
+ // observable entry with the new naming attribute.
+ // We don't need to worry about multiple RDN
+ // attributes here since the user has no chance
+ // to select multiple naming attributes when using
+ // the UG adapter.
+ if ((rdnAttrs != null) && (rdnAttrs[0] != null)) {
+ observableentry.setIndexAttribute(rdnAttrs[0]);
+ }
}
return (dlg != null);
}
diff --git a/src/com/netscape/admin/dirserv/DSEntryDialog.java b/src/com/netscape/admin/dirserv/DSEntryDialog.java
index 052a1d7..bb9864b 100644
--- a/src/com/netscape/admin/dirserv/DSEntryDialog.java
+++ b/src/com/netscape/admin/dirserv/DSEntryDialog.java
@@ -79,7 +79,7 @@ public class DSEntryDialog extends AbstractDialog {
*
* @return Any attributes defined for the entry.
*/
- public LDAPAttributeSet getAttributes() {
+ public LDAPAttributeSet getAttributes() {
return (_entryPanel.getAttributes());
}
@@ -91,6 +91,10 @@ public class DSEntryDialog extends AbstractDialog {
return (_entryPanel.getDN());
}
+ public String[] getNamingAttributes() {
+ return (_entryPanel.getNamingAttributes());
+ }
+
public void packAndShow() {
pack();
/* Using pack the window can be too big (for example for the entry of the schema)*/
13 years, 1 month
console/src/com/netscape/management/client/ug ResourceEditor.java, 1.1.1.1, 1.2 ResourcePageObservable.java, 1.3, 1.4
by Nathan Kinder
Author: nkinder
Update of /cvs/dirsec/console/src/com/netscape/management/client/ug
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv5262/src/com/netscape/management/client/ug
Modified Files:
ResourceEditor.java ResourcePageObservable.java
Log Message:
Bug 229699 - objectclass without parent causes StringIndexOutOfBounds in console
The exception was occuring since the Console assumed that an entry created by
going to "New->User" would have the givenname and sn attribute present and
never checked if they were null before calling the String.substring() method.
The fix is to first check if these attributes are null.
There were other issues around this problem as well. The
ResourcePageObservable class that is used to represent the entry being edited
keeps a list of objectclasses along with the list of attributes and values for
the entry (including the objectclass attribute). The problem was that removing
an objectclass from the entry in the editor did not remove the objectclass from
the objectclass list. This causes the editor to make assumptions about the
entry, such as the presence of the givenname and sn attribute that caused the
exception. The fix is to sync the objectclass list with the actual
objectclasses that are present in the entry when a change is made.
Index: ResourceEditor.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/ug/ResourceEditor.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ResourceEditor.java 18 Jul 2005 00:34:23 -0000 1.1.1.1
+++ ResourceEditor.java 1 Mar 2011 19:24:56 -0000 1.2
@@ -799,6 +799,8 @@
String sAttrName = (String) arg;
if ((sAttrName != null) &&
(sAttrName.toLowerCase().equals("objectclass"))) {
+ // refresh the objectclass list
+ ((ResourcePageObservable)o).syncObjectClassList();
// update the plugin
setupPlugin(((ResourcePageObservable) o).get("objectclass"));
}
Index: ResourcePageObservable.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/ug/ResourcePageObservable.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ResourcePageObservable.java 7 Feb 2011 19:49:52 -0000 1.3
+++ ResourcePageObservable.java 1 Mar 2011 19:24:56 -0000 1.4
@@ -125,6 +125,17 @@
/**
+ * Synchronizes the objectclass list with the objectclass
+ * attribute values that are present in the observable.
+ *
+ * @param objectClassList vector of object classes
+ */
+ public void syncObjectClassList() {
+ _objectClassList = get("objectclass");
+ }
+
+
+ /**
* Gets the LDAPEntry for the specified DN
*
* @param DN the LDAPEntry to retrieve
@@ -293,15 +304,21 @@
} else if ( sAttribute.toLowerCase().
equalsIgnoreCase(
ID_FORMAT_FIRSTLETTER_LASTNAME)) {
- sUID = get(STRING_GIVENNAME,
- 0).substring(0, 1) +
- get(STRING_SN, 0);
+ String givenName = get(STRING_GIVENNAME, 0);
+ String sn = get(STRING_SN, 0);
+ if ((givenName != null) && !givenName.equals("") &&
+ (sn != null) && (!sn.equals(""))) {
+ sUID = givenName.substring(0, 1) + sn;
+ }
} else if ( sAttribute.toLowerCase().
equalsIgnoreCase(
ID_FORMAT_GIVENNAME_FIRSTLETTER)) {
- sUID = get(STRING_GIVENNAME,
- 0) + get(STRING_SN,
- 0).substring(0, 1);
+ String givenName = get(STRING_GIVENNAME, 0);
+ String sn = get(STRING_SN, 0);
+ if ((givenName != null) && !givenName.equals("") &&
+ (sn != null) && (!sn.equals(""))) {
+ sUID = givenName + sn.substring(0, 1);
+ }
} else if ( sAttribute.toLowerCase().
equalsIgnoreCase(
ID_FORMAT_LASTNAME_GIVENNAME)) {
@@ -366,7 +383,7 @@
_entry = newEntry;
- // Refresh so we get a copy of the entrt from the DS. This ensures
+ // Refresh so we get a copy of the entry from the DS. This ensures
// that we see any updates that the DS added to the entry.
refresh();
}
13 years, 1 month
Branch '389-ds-base-1.2.8' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/index.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 3b33ef436e26a482a939078f4747522e65789295
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Mon Feb 28 16:54:11 2011 -0800
Bug 679978 - modifying attr value crashes the server, which is supposed to
be indexed as substring type, but has octetstring syntax
https://bugzilla.redhat.com/show_bug.cgi?id=679978
Description: When indexing, index_addordel_values_ext_sv calls a helper
function valuearray_minus_valuearray in index.c. There is a corner case
that could pass NULL array arguments to valuearray_minus_valuearray.
In valuearray_minus_valuearray, the array's elements were accessed w/o
checking the array was NULL or not. This patch is adding the check.
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index 73275fc..03ea5e4 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -2152,10 +2152,10 @@ valuearray_minus_valuearray(
}
/* determine length of a */
- for (acnt = 0; a[acnt] != NULL; acnt++);
+ for (acnt = 0; a && a[acnt] != NULL; acnt++);
/* determine length of b */
- for (bcnt = 0; b[bcnt] != NULL; bcnt++);
+ for (bcnt = 0; b && b[bcnt] != NULL; bcnt++);
/* allocate return array as big as a */
c = (Slapi_Value**)slapi_ch_calloc(acnt+1, sizeof(Slapi_Value*));
13 years, 1 month
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/back-ldbm/index.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 6d4566ee11e3789c9f9ebacea8bde420f36cb6fd
Author: Noriko Hosoi <nhosoi(a)jiji.usersys.redhat.com>
Date: Mon Feb 28 16:54:11 2011 -0800
Bug 679978 - modifying attr value crashes the server, which is supposed to
be indexed as substring type, but has octetstring syntax
https://bugzilla.redhat.com/show_bug.cgi?id=679978
Description: When indexing, index_addordel_values_ext_sv calls a helper
function valuearray_minus_valuearray in index.c. There is a corner case
that could pass NULL array arguments to valuearray_minus_valuearray.
In valuearray_minus_valuearray, the array's elements were accessed w/o
checking the array was NULL or not. This patch is adding the check.
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index 73275fc..03ea5e4 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -2152,10 +2152,10 @@ valuearray_minus_valuearray(
}
/* determine length of a */
- for (acnt = 0; a[acnt] != NULL; acnt++);
+ for (acnt = 0; a && a[acnt] != NULL; acnt++);
/* determine length of b */
- for (bcnt = 0; b[bcnt] != NULL; bcnt++);
+ for (bcnt = 0; b && b[bcnt] != NULL; bcnt++);
/* allocate return array as big as a */
c = (Slapi_Value**)slapi_ch_calloc(acnt+1, sizeof(Slapi_Value*));
13 years, 1 month