From a336e58b7acc4d40021c89bfa2b678658526b6c4 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 27 Apr 2025 14:03:21 +1000 Subject: [PATCH] Fixes for 389 Directory Server - addresses recursion issue #314. The primary issue was that 389DS doesnt render the subschemaSubentry attribute unless it is specifically requested. --- README.md | 2 +- app/Classes/LDAP/Attribute.php | 2 +- app/Classes/LDAP/Schema/Base.php | 2 +- app/Classes/LDAP/Server.php | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cde0852d..ae968d8f 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Support is known for these LDAP servers: - [X] OpenLDAP - [X] OpenDJ - [ ] Microsoft Active Directory -- [ ] 389 Directory Server +- [X] 389 Directory Server If there is an LDAP server that you have that you would like to have supported, please open an issue to request it. You might need to provide access, provide a copy or instructions to get an environment for testing. If you have enabled diff --git a/app/Classes/LDAP/Attribute.php b/app/Classes/LDAP/Attribute.php index 2d8a8bc9..8d83f9ca 100644 --- a/app/Classes/LDAP/Attribute.php +++ b/app/Classes/LDAP/Attribute.php @@ -311,7 +311,7 @@ class Attribute implements \Countable, \ArrayAccess */ public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View { - $view = match ($this->schema->syntax_oid) { + $view = match ($this->schema?->syntax_oid) { self::SYNTAX_CERTIFICATE => view('components.syntax.certificate'), self::SYNTAX_CERTIFICATE_LIST => view('components.syntax.certificatelist'), diff --git a/app/Classes/LDAP/Schema/Base.php b/app/Classes/LDAP/Schema/Base.php index bdac25c2..74265c83 100644 --- a/app/Classes/LDAP/Schema/Base.php +++ b/app/Classes/LDAP/Schema/Base.php @@ -20,7 +20,7 @@ abstract class Base { protected string $name = ''; // The OID of this schema item. - protected string $oid; + protected string $oid = ''; # The description of this schema item. protected string $description = ''; diff --git a/app/Classes/LDAP/Server.php b/app/Classes/LDAP/Server.php index 8d3d58f6..7e61f095 100644 --- a/app/Classes/LDAP/Server.php +++ b/app/Classes/LDAP/Server.php @@ -361,7 +361,8 @@ final class Server // Try to get the schema DN from the specified entry. $schema_dn = $this->schemaDN(); - $schema = $this->fetch($schema_dn); + // @note: 389DS does not return subschemaSubentry unless it is requested + $schema = $this->fetch($schema_dn,['*','+','subschemaSubentry']); // If our schema's null, we didnt find it. if (! $schema)