Files
mars_nwe_pcab/SQLITE-IDENTITIES.md

5.8 KiB
Raw Permalink Blame History

MARS NWE — SQLite identities (development update)

Base: 0.9.1-3 with RetroBrowser token fix and Directory Wizard.

Scope

This adds a SQLite-backed Unix identity resolver for new NetWare users, not a replacement for the NetWare credential store. Existing Bindery records, passwords, groups, trustees, login scripts, and Linux account mappings remain unchanged. The only active on-wire mode is NetWare 3.x/Bindery. The wizard shows NetWare 4.x/NDS as unavailable. No fake tree advertisement or NDS login is provided. NDS requires SAP 0x0278, NCP 104/NDAP fragmentation, name/schema operations, NDS challenge/response and authenticated NCP connection binding.

Build and deployment

Apply exactly one patch to the corresponding source base, with git apply --check first:

  • MARS_NWE-sqlite-identities.patch — previous directory wizard already applied.
  • MARS_NWE-directory-and-sqlite.patch — tokenfix already applied, no wizard yet.
  • For pristine 0.9.1-3, apply MARS_NWE-directory-wizard-with-tokenfix.patch, then MARS_NWE-sqlite-identities.patch.

Do not mix these alternatives. Before applying, commit or back up local modifications. The source archive we received lacks upstream-adapter/mars_admin.inc, mars_scripts.inc, mars_acl.inc, and mars_trustee.inc. Use your complete working repository with these original files. Do not overwrite newer adapters with older copies. patch-upstream.sh fails on missing or unknown source anchors. The original source tree may be reused by setting MARS_SOURCE_DIR if needed; rebuild.sh removes only upstream/patched and upstream/build, not upstream/original. It requires the existing upstream tree or network access for the original clone.

sudo apt-get install libsqlite3-dev libcivetweb-dev libjson-c-dev libssl-dev
make check-identity check-directory check-native
node tests/test_directory_ui.cjs
./rebuild.sh

A full rebuild of nwbind/nwconn/nwserv and other linked components is required, not just make native. On a test system first, back up the running configuration, Bindery DB and all volumes/ownership/trustees. Run sudo ./install.sh only after successful full build. The existing installer stops the running service; schedule downtime. Restart using sudo systemctl start mars_vme.service. Reload web frontend. Do not install on a production server until the native and upstream builds and real logins are tested.

Guided operation

Live-Bindery → + Benutzer (SQLite). Enter NetWare name and password. The API checks the live nwbind handshake and full object list, reserves a unique UID/GID, verifies actual lookup inside nwbind, and invokes its original create-user operation. No useradd is performed. The existing manual Linux mapping flow is still available as + Benutzer (Linux-Konto). Use Identitäten prüfen to see reserved IDs and matching live Bindery mappings. Wizard step 1 reports SQLite availability and the actual protocol mode. Password changes, groups and login scripts use the existing Bindery actions.

The live handshake verifies lookup in nwbind, not full client login or nwconn permissions. If the operation fails or times out, the UID remains reserved. Inspect the live Bindery list before repeating. Never manually reassign reserved IDs. New user creation is blocked if the list is truncated. After deletion, old UID/GID values are never recycled; files may still be owned by them. No automatic migration of existing Linux accounts or SUPERVISOR is performed. The existing initial setup still requires a valid local supervisor mapping. Existing configured Unix-authentication policies may not be compatible with virtual accounts; use normal NetWare password authentication.

Storage and security

Database: /var/lib/mars-identities/identities.sqlite3. Root-owned directory (0755), root-owned DB (0644) so MARS processes can resolve identities after privilege drop. It contains non-secret identity metadata (NetWare name, synthetic alias, UID/GID, created_at), not passwords. Names are locally readable like /etc/passwd. The protected Bindery remains authoritative for credentials, enabled state, object IDs, membership and rights. Back up the SQLite DB, Bindery and volume ownership together while stopped. Do not regenerate the SQLite DB on an existing volume; ownership depends on stable numbers. Reserve 200000000–200099999 exclusively for MARS; audit host NSS, subordinate IDs and existing numeric file ownership before deploying. The resolver checks NSS for UID/GID/name collisions, refuses conflicts and never uses UID 0. The alias prefix marsv is reserved. No global NSS edits, no shell login, no synthetic home export. Direct manual assignment of reserved aliases through the web API is blocked. No migration of file ownership is performed.

Use an isolated retro LAN, preferably HTTPS for web administration. Classic NetWare/IPX password mechanisms do not provide modern transport security.

Testing / release gate

make check-identity tests local SQLite allocation and C linker wrappers, including real Linux DAC separation when run as root, and mocked Bindery API interactions. make check-directory and node tests/test_directory_ui.cjs verify the existing wizard. These do not prove NetWare login or trustee behavior. Required end-to-end acceptance on a test installation: create two users, verify no entries in /etc/passwd, log in from XP and DOS, test separate private files, EVERYONE membership, trustees, password change, disable/enable, reconnect after restart, deletion and no UID reuse. Test existing real Linux account login and permissions too. Audit numeric UID/GID use in upstream nwconn, nwbind, quota, print and trustee paths. Full source tree and CivetWeb dev headers were not available for this build in the development environment. No NDS login can be tested until a real NDAP implementation is available.