summaryrefslogtreecommitdiffstats
path: root/ldap/servers/ntds
diff options
context:
space:
mode:
authorDavid Boreham <dboreham@redhat.com>2005-04-27 16:19:28 +0000
committerDavid Boreham <dboreham@redhat.com>2005-04-27 16:19:28 +0000
commitd25731e8a08a6da9fe6290f00bafd3600246f3c4 (patch)
tree1fcfb7e9df262e4fce835ae2ed9fe4fc22aacf03 /ldap/servers/ntds
parent474810959a403f00b4249ce4281d78a152af4b20 (diff)
downloadds-d25731e8a08a6da9fe6290f00bafd3600246f3c4.tar.gz
ds-d25731e8a08a6da9fe6290f00bafd3600246f3c4.tar.xz
ds-d25731e8a08a6da9fe6290f00bafd3600246f3c4.zip
Fix handling of group membership, fix installer GUID, fix handling of entry description
Diffstat (limited to 'ldap/servers/ntds')
-rw-r--r--ldap/servers/ntds/apacheds/Makefile2
-rw-r--r--ldap/servers/ntds/apacheds/org/apache/ldap/server/NetAPIPartition.java48
-rw-r--r--ldap/servers/ntds/netman/netman.cpp68
-rw-r--r--ldap/servers/ntds/netman/netman.h6
-rw-r--r--ldap/servers/ntds/wrapper/wix/ntds.wxs2
5 files changed, 117 insertions, 9 deletions
diff --git a/ldap/servers/ntds/apacheds/Makefile b/ldap/servers/ntds/apacheds/Makefile
index 0e1484cf..a0840cbf 100644
--- a/ldap/servers/ntds/apacheds/Makefile
+++ b/ldap/servers/ntds/apacheds/Makefile
@@ -75,7 +75,7 @@ $(APACHEDSSOURCE)/core/target: $(JAVA_DEST_DIR)/ntds/jnetman.jar
$(USERSYNCJAR): $(APACHEDSSOURCE)/core/target
( cd $(APACHEDSSOURCE)/core/target/schema && pwd && jar cf usersync.jar org)
$(MV) $(APACHEDSSOURCE)/core/target/schema/usersync.jar $(USERSYNCJAR)
+ $(RM) $(APACHEDSSOURCE)/core/target
clean:
- $(RM) $(APACHEDSSOURCE)/core/target
$(RM) $(USERSYNCJAR)
diff --git a/ldap/servers/ntds/apacheds/org/apache/ldap/server/NetAPIPartition.java b/ldap/servers/ntds/apacheds/org/apache/ldap/server/NetAPIPartition.java
index 3580f923..a5ac5a6b 100644
--- a/ldap/servers/ntds/apacheds/org/apache/ldap/server/NetAPIPartition.java
+++ b/ldap/servers/ntds/apacheds/org/apache/ldap/server/NetAPIPartition.java
@@ -78,7 +78,7 @@ import org.bpi.jnetman.*;
public class NetAPIPartition implements ContextPartition {
static {
- System.loadLibrary("jnetman");
+ System.loadLibrary("jnetman");
System.out.println("dll loaded");
}
@@ -208,7 +208,7 @@ public class NetAPIPartition implements ContextPartition {
}
if(normName.toString().compareToIgnoreCase(suffix) == 0) {
- // Gets us past the CoreContestFactory.startUpAppPartitions
+ // Gets us past the CoreContextFactory.startUpAppPartitions
}
else if((normName.toString().toLowerCase().endsWith(container + "," + suffix)) &&
(normName.toString().toLowerCase().startsWith(new String("sAMAccountName").toLowerCase()))) {
@@ -223,6 +223,10 @@ public class NetAPIPartition implements ContextPartition {
}
else if(attribute.contains("group")) {
attribute = entry.get("groupType");
+ if(attribute == null) {
+ throw new NamingException("Missing groupType");
+ }
+
if(((new Integer((String)attribute.get())).intValue() & GLOBAL_FLAG) == GLOBAL_FLAG) {
group.NewGroup(rdn);
modNTGroupAttributes(group, modItems);
@@ -633,7 +637,7 @@ public class NetAPIPartition implements ContextPartition {
result = true;
}
- // Ae exception raised in searchAccounts is treated as a false hasEntry result
+ // An exception raised in searchAccounts is treated as a false hasEntry result
try {
if(searchAccounts(name, new Properties(), new PresenceNode(null), new SearchControls(), new BasicAttribute(null)) > 0) {
result = true;
@@ -1172,6 +1176,10 @@ public class NetAPIPartition implements ContextPartition {
attribute.add(new Long(GLOBAL_FLAG).toString());
attributes.put(attribute);
+ attribute = new BasicAttribute("description");
+ attribute.add(group.GetComment());
+ attributes.put(attribute);
+
attribute = new BasicAttribute("member");
result = group.LoadUsers();
if(result != 0) {
@@ -1224,6 +1232,10 @@ public class NetAPIPartition implements ContextPartition {
attribute.add(new Long(DOMAINLOCAL_FLAG).toString());
attributes.put(attribute);
+ attribute = new BasicAttribute("description");
+ attribute.add(localGroup.GetComment());
+ attributes.put(attribute);
+
attribute = new BasicAttribute("member");
result = localGroup.LoadUsers();
if(result != 0) {
@@ -1469,13 +1481,24 @@ public class NetAPIPartition implements ContextPartition {
private void modNTGroupAttributes(NTGroup group, ModificationItem[] mods) throws NamingException {
for(int i = 0; i < mods.length; i++) {
- if(mods[i].getAttribute().getID().compareToIgnoreCase("member") == 0) {
+ if(mods[i].getAttribute().getID().compareToIgnoreCase("description") == 0) {
+ if(mods[i].getModificationOp() == DirContext.ADD_ATTRIBUTE) {
+ group.SetComment((String)mods[i].getAttribute().get());
+ }
+ else if(mods[i].getModificationOp() == DirContext.REMOVE_ATTRIBUTE) {
+ group.SetComment("");
+ }
+ else if(mods[i].getModificationOp() == DirContext.REPLACE_ATTRIBUTE) {
+ group.SetComment((String)mods[i].getAttribute().get());
+ }
+ }
+ else if(mods[i].getAttribute().getID().compareToIgnoreCase("member") == 0) {
String tempName;
if(mods[i].getModificationOp() == DirContext.ADD_ATTRIBUTE) {
for(int j = 0; j < mods[i].getAttribute().size(); j++) {
tempName = getRDN((String)mods[i].getAttribute().get(j));
- group.AddUser((String)mods[i].getAttribute().get(j));
+ group.AddUser(tempName);
}
}
else if(mods[i].getModificationOp() == DirContext.REMOVE_ATTRIBUTE) {
@@ -1515,13 +1538,24 @@ public class NetAPIPartition implements ContextPartition {
private void modNTLocalGroupAttributes(NTLocalGroup localGroup, ModificationItem[] mods) throws NamingException {
for(int i = 0; i < mods.length; i++) {
- if(mods[i].getAttribute().getID().compareToIgnoreCase("member") == 0) {
+ if(mods[i].getAttribute().getID().compareToIgnoreCase("description") == 0) {
+ if(mods[i].getModificationOp() == DirContext.ADD_ATTRIBUTE) {
+ localGroup.SetComment((String)mods[i].getAttribute().get());
+ }
+ else if(mods[i].getModificationOp() == DirContext.REMOVE_ATTRIBUTE) {
+ localGroup.SetComment("");
+ }
+ else if(mods[i].getModificationOp() == DirContext.REPLACE_ATTRIBUTE) {
+ localGroup.SetComment((String)mods[i].getAttribute().get());
+ }
+ }
+ else if(mods[i].getAttribute().getID().compareToIgnoreCase("member") == 0) {
String tempName;
if(mods[i].getModificationOp() == DirContext.ADD_ATTRIBUTE) {
for(int j = 0; j < mods[i].getAttribute().size(); j++) {
tempName = getRDN((String)mods[i].getAttribute().get(j));
- localGroup.AddUser((String)mods[i].getAttribute().get(j));
+ localGroup.AddUser(tempName);
}
}
else if(mods[i].getModificationOp() == DirContext.REMOVE_ATTRIBUTE) {
diff --git a/ldap/servers/ntds/netman/netman.cpp b/ldap/servers/ntds/netman/netman.cpp
index c6c86730..885c3da7 100644
--- a/ldap/servers/ntds/netman/netman.cpp
+++ b/ldap/servers/ntds/netman/netman.cpp
@@ -1436,6 +1436,40 @@ char* NTGroup::GetSIDHexStr()
}
// ****************************************************************
+// NTGroup::GetComment
+// ****************************************************************
+char* NTGroup::GetComment()
+{
+ char* result = NULL;
+
+ if(groupInfo != NULL)
+ {
+ result = UTF16ToUTF8(groupInfo->grpi2_comment);
+ }
+
+ return result;
+}
+
+// ****************************************************************
+// NTGroup::SetComment
+// ****************************************************************
+int NTGroup::SetComment(char* comment)
+{
+ int result = 0;
+
+ if(groupInfo != NULL)
+ {
+ groupInfo->grpi2_comment = UTF8ToUTF16(comment);
+ }
+ else
+ {
+ result = -1;
+ }
+
+ return result;
+}
+
+// ****************************************************************
// NTGroup::AddUser
// ****************************************************************
int NTGroup::AddUser(char* userName)
@@ -1767,6 +1801,40 @@ char* NTLocalGroup::GetSIDHexStr()
}
// ****************************************************************
+// NTLocalGroup::GetComment
+// ****************************************************************
+char* NTLocalGroup::GetComment()
+{
+ char* result = NULL;
+
+ if(localGroupInfo != NULL)
+ {
+ result = UTF16ToUTF8(localGroupInfo->lgrpi1_comment);
+ }
+
+ return result;
+}
+
+// ****************************************************************
+// NTLocalGroup::SetComment
+// ****************************************************************
+int NTLocalGroup::SetComment(char* comment)
+{
+ int result = 0;
+
+ if(localGroupInfo != NULL)
+ {
+ localGroupInfo->lgrpi1_comment = UTF8ToUTF16(comment);
+ }
+ else
+ {
+ result = -1;
+ }
+
+ return result;
+}
+
+// ****************************************************************
// NTLocalGroup::AddUser
// ****************************************************************
int NTLocalGroup::AddUser(char* username)
diff --git a/ldap/servers/ntds/netman/netman.h b/ldap/servers/ntds/netman/netman.h
index 0db83566..0771b16a 100644
--- a/ldap/servers/ntds/netman/netman.h
+++ b/ldap/servers/ntds/netman/netman.h
@@ -170,6 +170,9 @@ public:
char* GetAccountName();
char* GetSIDHexStr();
+ char* GetComment();
+ int SetComment(char* comment);
+
int AddUser(char* username);
int RemoveUser(char* username);
int LoadUsers();
@@ -225,6 +228,9 @@ public:
char* GetAccountName();
char* GetSIDHexStr();
+ char* GetComment();
+ int SetComment(char* comment);
+
int AddUser(char* username);
int RemoveUser(char* username);
int LoadUsers();
diff --git a/ldap/servers/ntds/wrapper/wix/ntds.wxs b/ldap/servers/ntds/wrapper/wix/ntds.wxs
index 4e6b940b..7a728473 100644
--- a/ldap/servers/ntds/wrapper/wix/ntds.wxs
+++ b/ldap/servers/ntds/wrapper/wix/ntds.wxs
@@ -36,7 +36,7 @@
All rights reserved.
END COPYRIGHT BLOCK -->
<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
- <Product Name='NT User Synchronization' Id='DB501C18-86C7-4D14-AEC0-86416A69ABD0'
+ <Product Name='NT User Synchronization' Id='9FABDEC3-CAA0-40D5-871F-A0E1759C38C1'
Language='1033' Codepage='1252'
Version='1.0.0' Manufacturer='Brandx'>