diff options
| author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2025-10-05 16:50:04 -0500 |
|---|---|---|
| committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2025-10-22 19:18:20 -0500 |
| commit | 341554f0137567dfa228460e9eb97c0f658f39d6 (patch) | |
| tree | 82a5cd1a8644bebdbaca443199900ac32979561e | |
| parent | dcffb30580fd72f07e210e29bc58be8e0fd0a1b5 (diff) | |
| download | libtdeldap-341554f0.tar.gz libtdeldap-341554f0.zip | |
Add group support
| -rw-r--r-- | src/libtdeldap.cpp | 11 | ||||
| -rw-r--r-- | src/libtdeldap.h | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp index 7974164..78c3b65 100644 --- a/src/libtdeldap.cpp +++ b/src/libtdeldap.cpp @@ -2054,7 +2054,7 @@ int LDAPManager::updateGroupInfo(LDAPGroupInfo group, TQString *errstr) { else { // Assemble the LDAPMod structure // We will replace any existing attributes with the new values - int number_of_parameters = 3; // 3 primary attributes + int number_of_parameters = 4; // 4 primary attributes LDAPMod *mods[number_of_parameters+1]; set_up_attribute_operations(mods, number_of_parameters); @@ -2078,6 +2078,7 @@ int LDAPManager::updateGroupInfo(LDAPGroupInfo group, TQString *errstr) { posixGroupList.append(plainUserName); } add_multiple_attributes_operation(mods, &i, "memberUid", posixGroupList); + add_single_attribute_operation(mods, &i, "displayName", group.displayName); LDAPMod *prevterm = mods[i]; mods[i] = NULL; @@ -2181,7 +2182,7 @@ int LDAPManager::addGroupInfo(LDAPGroupInfo group, TQString *errstr) { } else { // Create the base DN entry - int number_of_parameters = 6; // 6 primary attributes + int number_of_parameters = 7; // 7 primary attributes LDAPMod *mods[number_of_parameters+1]; set_up_attribute_operations(mods, number_of_parameters); @@ -2190,9 +2191,10 @@ int LDAPManager::addGroupInfo(LDAPGroupInfo group, TQString *errstr) { // Load initial required LDAP object attributes i=0; create_single_attribute_operation(mods, &i, "gidNumber", TQString("%1").arg(group.gid)); - create_multiple_attributes_operation(mods, &i, "objectClass", TQStringList::split(" ", "emsGroup groupOfNames posixGroup")); + create_multiple_attributes_operation(mods, &i, "objectClass", TQStringList::split(" ", "emsGroup groupOfNames posixGroup tdeExtendedGroupData")); create_single_attribute_operation(mods, &i, "cn", group.name); create_multiple_attributes_operation(mods, &i, "member", TQStringList(placeholderGroup)); + add_single_attribute_operation(mods, &i, "displayName", group.displayName); // Zivios specific create_single_attribute_operation(mods, &i, "emsdescription", "None"); create_single_attribute_operation(mods, &i, "emstype", "GroupEntry"); @@ -2577,6 +2579,9 @@ LDAPGroupInfo LDAPManager::parseLDAPGroupRecord(LDAPMessage* entry) { else if (ldap_field == "gidNumber") { groupinfo.gid = atoi(vals[i]->bv_val); } + else if (ldap_field == "displayName") { + groupinfo.displayName = vals[i]->bv_val; + } else if (ldap_field == "tdeBuiltinAccount") { groupinfo.tde_builtin_account = (TQString(vals[i]->bv_val).upper() == "TRUE")?true:false; } diff --git a/src/libtdeldap.h b/src/libtdeldap.h index 881c2fb..e9fe3e1 100644 --- a/src/libtdeldap.h +++ b/src/libtdeldap.h @@ -370,6 +370,7 @@ class TDE_EXPORT LDAPGroupInfo TQString creatorsName; TQString name; + TQString displayName; gid_t gid; bool tde_builtin_account; TQStringList userlist; |
