SD Core for Windows WC2.0-0

Differences from W1.0-0

What changed for someone who already knows SD Core for Windows, grouped by theme rather than by date.

This page is for somebody who used W1.0-0 and is looking at W1.1-3. Everything else in this set already describes the current behavior on its own terms; this page exists only to say what is different, and to flag what might stop working after an upgrade.

The day-by-day version of everything below — every fix, in the order it was made — ships on the machine at C:\ProgramData\SD\sdsys\changelog (or config gpl from an sd prompt for the license, LIST.VOCLIB is not it; the changelog is a plain text file in the SDSYS account's install tree). This page is the same material, reorganized.

Accounts: the tiers are gone#

Standard, Programmer and Administrator no longer exist. Every account create.account makes gets the whole vocabulary — the same one SDSYS uses — and the only account with anything more is SDSYS itself, which is not something create.account can produce at all. See Accounts, which describes the current model in full — do not read an account-tier explanation anywhere else in this set or in an older document as still true.

What used to be a tier change is now a suspension. modify.account <account> suspended denies an account every door; unsuspended reverses it. Naming a tier keyword anywhere — create.account, modify.account, or to lift what used to be a downgrade — is now a syntax error.

The route keyword on create.account is optional, and defaults to BOTH (ssh and the API) rather than refusing until you name one. See Creating an account.

Reaching SDSYS#

SDSYS is reached only by signing in to Windows as SDSYS and starting sd from an elevated prompt. Being a Windows administrator in your own account no longer gets you into SDSYS, or gives your own account anything SDSYS has — not CATALOG ... GLOBAL, not SH/!/EDIT/MICRO without a grant, not BREAK ON USER, not PDUMP of another user's session. All of that used to follow from Windows elevation; none of it does now. See SDSYS is the only administrator.

logto SDSYS never enters SDSYS for the first time, from anywhere, elevated or not — the only way in is a session that starts there. A session that started in SDSYS and logtos down to an ordinary account can logto SDSYS back up again, which did not work before: leaving SDSYS used to end the elevated session.

SH and ! are back on ordinary accounts — gated the same way they always should have been, by an administrator's grant (modify.account <account> sh-on, a switch of the account), not by whether the account could type the command at all.

Passwords are stronger, and yours to change#

A password must now be at least 8 characters and contain a lower-case letter, an upper-case letter, a digit and a symbol, everywhere SD Core for Windows sets one: modify.password, create.account, an elevated session's first-run prompt, and the SDSYS password the installer asks for.

modify.password typed on its own now changes your own password, for every account. Before this it belonged to SDSYS alone, so an ordinary account had no way to change what it had been given. Naming another account's name still needs an administrator session, and still sets the password without asking for the old one.

The API is now encrypted end to end#

The full description is The connection is encrypted. Until W1.1-0, only the API login was protected: the password never crossed the network, but every command, every record and every result after it did, as plain text. Every API connection — the network port and the local one alike — is now wrapped in TLS 1.3 before SD sends anything, and the login itself is bound to that encrypted connection, so a machine sitting between a client and the server cannot log in on the client's behalf or read the traffic, even by pretending to be the server.

The client libraries do this automatically. sdclilib, sdclient and the BASIC !sdclient class all negotiate TLS themselves. A program linked against an older copy of the library cannot connect at all — the server waits for the encryption handshake and closes the connection after ten seconds of silence. Relink it against the current library.

A new low-privilege Windows account, sdrelay, appears in Computer Management. The small helper program that terminates the encryption for each connection (sdtlsrelay.exe, beside sd.exe) used to run with the same privilege as the SD service itself — LocalSystem — so a flaw in the encryption code could in the worst case hand a remote caller that privilege before they had even signed in. It now runs as sdrelay, an account with every privilege stripped, at low integrity, unable to sign in interactively and belonging to no group. Leave it alone: SD's service creates it and removes it. If it is deleted by hand, every API connection is refused until the service is reinstalled.

What this did not do in W1.1: a client did not check the server's certificate. The encryption stopped a machine in the middle from reading traffic or logging in on your behalf, but such a machine could still record a login attempt and try to guess the password later, offline. From WC2.0-0 the client library remembers each server's certificate (API access, "The client library remembers each server's certificate"). Use long API passwords that are not reused elsewhere.

An API session now runs as the Windows user who logged in, not as the service account. Before this, every API session ran as LocalSystem and only pretended to be you for some checks — it could read or write anything LocalSystem could, even though the files it created were correctly owned by you. Now it can only reach what your own Windows account may. See An API session runs as you.

What might stop working, and it is the point rather than a fault. An API program that used to read or write a file your Windows account has no permission on will now be refused. That only ever worked because the session was effectively LocalSystem. If something that worked before now says it cannot open a file, check that file's Windows permissions for the account the API session logs in as.

SH and OS.EXECUTE do not work from an API session in this release. Windows will not let a process started the way an API login starts one launch anything that needs a desktop — which includes PowerShell. Console sessions and ssh are unaffected. See sh and OS.EXECUTE over the API.

The API port is 4247#

The API listens on port 4247, and nothing can change it. It was 4243, which OpenQM and ScarletDME also use, so SD could not run beside either. No setting, installer option or command takes a port, so every SD Core for Windows system uses the same one. See The port.

APIPORT in sd.conf now only switches the API on. Any number above zero means on, and SD listens on 4247 whatever the number is, so an sd.conf that says APIPORT=4243 keeps working and now means 4247. An upgrade moves SD's own firewall rule, SD-API-In-TCP, from 4243 to 4247 and leaves who may reach it as it was. A rule you made yourself for 4243 is not touched, and no longer does anything for SD.

A program that names port 4243 must name 4247 instead. The client library and the BASIC !sdclient class both default to 4247, so a program that names no port needs no change.

Backing up and restoring accounts#

Four new commands, all SDSYS's. set.backup.directory makes a backup folder and remembers it (in sd.conf, as BACKUPDIR=). backup.account writes the accounts you name, or every account but SDSYS, to one zip file there. restore.account puts accounts back from a zip file, or from the newest backup made on this computer if you say latest. settings.report writes a text report of the system's settings for you to keep.

A backup holds each account's files and what is needed to make the account again, and never a password. An account that no longer exists is made again and asks for a new password. While a backup or a restore runs, nobody else may be signed in to SD, and new sign-ins are refused until it finishes. The whole page is Backing Up and Restoring Accounts, in the Administrator set.

ssh: port forwarding is off#

An ssh session can no longer be used to reach anything else. Every ssh login already went straight into sd rather than a command prompt; the server is now also told to refuse port forwarding, so ssh -L, ssh -R and ssh -D against the machine are refused. scp and sftp were already unreachable, because the session command was already forced.

An administrator's own account has no special ssh or API route — the rule is that Windows administrator status changes nothing about what an SD account may do remotely. See Reaching SDSYS above.

Nearly everything is lower case now#

Record ids no longer distinguish case, anywhere. A file can hold jack or JACK but never both; writing one when the other exists updates the same record. This is how the system files always behaved; it now holds for every file, including your own. CREATE.FILE ... CASE is no longer accepted.

SD's own vocabulary, dictionaries, cataloged program names and several VOC pointers are named in lower case — but every lookup tries what you typed first, then lower case, then upper case, so nothing you already type stops working. This has its own page, with the exceptions and the upgrade mechanics in full: Lower case.

Upgrading converts your existing files for you, and refuses to touch one that would lose a record — see nocase-upgrade.log in the SD data folder, and Upgrading and uninstalling.

The installer says less#

Every installer screen was cut down to what you need to install: what Setup changes, what to do next, and what to run if a step failed. The explanations of why are gone from the wizard and live instead in Installing SD Core for Windows: Warnings and Things to Know, under Warnings and things to know. Nothing Setup actually does changed.

voc_template keeps SDSYS's own VOC current: an upgrade replaces it, and update.accounts refreshes SDSYS's VOC from it (every other account's from newvoc).

Upgrading is quieter, and no longer hangs#

Upgrading no longer stops for around five minutes and then reports failure. It used to ask, at sign-in, whether to update an account's VOC to the new release — a question some upgrade steps trigger with no screen to show it on and nobody to answer it. The installer already updates every account's vocabulary itself, so the question is gone; upgrading finishes without waiting on it.

Each upgrade step now names itself before it runs, and the two steps that walk every account and every file — so they take longer the more you have — say so.

Uninstalling asks about your database and your settings file separately. Before, removing the database took sd.conf with it, because both live in the same folder; you can now keep one and discard the other. Removing the Windows accounts create.account made now actually works when the database is removed in the same pass — the two steps used to run in an order that deleted the list of which accounts to remove before removing them, which silently left every one of them in place, still able to sign in.

Printing reaches a real Windows printer#

A spooled print job (SETPTR mode 1) now goes to a Windows printer — the one named with AT, or your default printer — the same as OpenQM does. It used to be handed to a Linux print command that does not exist on Windows, and the job simply disappeared with no message.

One Windows setting to know about. "Let Windows manage my default printer" (on by default in Windows 10 and 11) makes your default printer silently become the last one used from any program — which may be Microsoft Print to PDF. If you have more than one printer, turn that setting off and choose your default, or always name the printer with AT in SETPTR.

SENDMAIL now says it is not supported, instead of reporting success and sending nothing.

Python is back, running outside the database#

The PY_ functions are available again — twenty of them, declared in $INCLUDE SDPYFUNC.H. What is different from before they were withdrawn: Python no longer runs inside sd.exe. It runs in a separate program, sdpy.exe, and a session talks to it down a pipe; the first PY_ call starts it and it goes away when the session ends. You need an all-users install of Python 3.13 or later — a "for me only" install cannot be used — and without one, every PY_ function simply returns -12040 and nothing else is affected. The installer can install Python for you from the release zip: see Installation.

Access follows the same rule as the shell. Whatever governs SH and OS.EXECUTE for an account — its os-on switch, or being SDSYS — governs Python too, since it can read and write files and start programs just as freely.

Smaller fixes worth knowing#

What might stop working#

Continued in#

Upgrading and uninstalling — what an upgrade does and does not touch, and the mechanics of the two changes above that affect it most: lower-case conversion and the quieter upgrade path.