5.0 KiB
Directory stack and storage-backend plan
This note records the current nwdirectory/TinyLDAP staging rule before the
NetWare 4.x/NDS work starts. It exists to keep LDAP compatibility, schema
import, setup tooling and the later FLAIM storage conversion from being mixed
into one unreviewable change.
Current code shape
The current TinyLDAP-derived component already builds a library and server under mars-nwe names:
libnwdirectory
TinyLDAP-derived library output
contains LDAP/ASN.1/LDIF/auth/helper code
contains the current flatfile/mmap/journal storage helpers
nwdirectory
LDAP server binary/service
uses libnwdirectory
The current storage files are the TinyLDAP flatfile path, including:
mstorage_add.c
mstorage_add_bin.c
mstorage_init.c
mstorage_init_persistent.c
mstorage_unmap.c
mduptab_*.c
strstorage/strduptab helpers
FLAIM is built in the mars-nwe directory-enabled superbuild today, but it should not be wired into the TinyLDAP storage path until the flatfile LDAP behaviour is covered by tests.
Target library chain
The later directory-service chain should be:
libnwds
-> libnwdirectory
-> libnwflaim
-> FLAIM
The nwdirectory name is the server/binary. libnwdirectory is the library
used by that server. libnwds is the future NetWare Directory Services API
layer above it, used by setup/import tools, future nwnds, Bindery integration
and any NetWare-facing directory policy code.
Implementation order
Do not combine LDAP protocol compatibility, NetWare schema import, setup tooling and the storage-engine swap. The first directory implementation phase is flatfile-only.
- Keep
libnwdirectoryon the current flatfile/mmap/journal backend. - Add LDAPv2 support to the TinyLDAP-derived server first. TinyLDAP is currently treated as the LDAPv3-era baseline; the uploaded OpenLDAP 1.0.3 tree is the historical LDAPv2 server reference for bind/search/result/BER behaviour, not a source tree to import wholesale.
- Add LDAPv2 CTests over TCP against
nwdirectorywith isolated temporary workdirs and free loopback ports. - Keep/add LDAPv3 CTests for behaviour that is already present or intentionally supported, but do not make LDAPv3 the NetWare 4.11 compatibility baseline.
- Make NetWare/NDS schema handling work on the flatfile backend. Prefer native
.schimport if practical; otherwise add a reviewed.schto LDIF conversion path. - Add
libnwdsand the firstnwsetuppath together. The firstnwsetupimplementation should be console/CLI-only so CTest can exercise initial setup without the futurenwtuifrontend. It should calllibnwds, andlibnwdsshould calllibnwdirectory; it should not bootstrap by acting as an LDAP client tonwdirectory. - Only after LDAPv2, LDAPv3 smoke coverage, schema import,
libnwdsand the consolenwsetuppath are stable on flatfile storage, add a FLAIM storage backend. - After the FLAIM backend is working, add the interactive
nwtui/nwtoolboxsetup frontend and the certificate/TLS directory-storage work as separate follow-up changes.
This keeps LDAPv2 improvements generally useful to the TinyLDAP-derived code,
keeps nwsetup testable before the UI exists, and keeps the later FLAIM backend
as a clearly mars-nwe-specific storage change.
Future storage-backend swap
The later FLAIM backend should be a parallel source set selected by CMake, not a large rewrite of every LDAP call site.
Example layout:
flatfile backend, default:
mstorage_add.c
mstorage_add_bin.c
mstorage_init.c
mstorage_init_persistent.c
mstorage_unmap.c
mduptab_*.c
flaim backend, later:
flaimstorage_add.c
flaimstorage_add_bin.c
flaimstorage_init.c
flaimstorage_init_persistent.c
flaimstorage_unmap.c
flaimduptab_*.c
The FLAIM files may keep the same exported function names as the flatfile files.
For example, flaimstorage_add_bin.c can provide mstorage_add_bin() when the
FLAIM backend is selected. Only one backend source set may be compiled into
libnwdirectory at a time.
That gives a reviewable storage replacement:
LDAP/server code -> existing mstorage/mduptab API -> selected backend
and avoids changing LDAP protocol logic while changing persistence.
CTest direction
LDAP server tests should not depend on system ldapsearch or OpenLDAP tools by
default. Prefer existing TinyLDAP client/test helpers where suitable, or add a
small in-tree client test.
A standard test should:
- allocate a unique temporary workdir;
- prepare test LDIF/schema data for the flatfile backend;
- start
nwdirectoryon127.0.0.1:<free-port>; - wait until the TCP port is ready;
- run LDAPv2 or LDAPv3 bind/search/unbind checks;
- stop the server;
- remove the workdir.
Suggested future test names:
nwdirectory.ldap.v2.bind-search-flatfile
nwdirectory.ldap.v3.bind-search-flatfile
nwdirectory.schema.sch-import-flatfile
nwds.setup.console-flatfile
nwdirectory.storage.flatfile.smoke
nwdirectory.storage.flaim.smoke # later, after the backend swap