Commit Graph
103 Commits
Author SHA1 Message Date
lotherk f46a914c73 dtchat: add the message catalog and the German UI (T10.4)
i18n.c opens catopen("dtchat", NL_CAT_LOCALE) and dc_text(id, fallback) reads set 1; the program calls dc_i18n_init after setlocale. The visible labels of the main window, the account editor, the request/peer/file/pair dialogs and the local status texts use ui_text.h ids; dtchat.msg (English) has 75 entries and programs/localized/de_DE.UTF-8/msg/dtchat.msg the German copy (ASCII transliteration, core font). test_i18n builds both catalogs with gencat and checks File/Datei, Send/Senden and the fallback; the German run under Xvfb shows Datei/Bearbeiten/Ansicht/Konversation/Hilfe, In der Naehe and Senden (screenshot build/mcde-shots/dtchat-t104-de.png) and the smoke stays green. Dynamic formatted statuses are partly still English. The in-tree build is pending: a foreign release chain holds the lock (pid 141722).
2026-11-17 07:06:55 +00:00
lotherk 134cacc93d dtchat: bind local identities to their keys and gate files on pairing (T10.2)
Security review findings: (1) the local peer identity was only a claimed pin; the listener now requests the client certificate and compares the certificate hash that completed the handshake with the pin in hello, refusing a mismatch or a missing certificate, and the client presents its identity certificate (test_local uses real identities: matching, other identity, any). (2) unpaired peers could send file offers; the UI manager carries a paired flag, answers offers from unpaired peers with file-reject 'pairing required' and refuses to send. The review document lists both fixes and the accepted limits (no passphrase, public pins, media nonces later, adapter spawn, file names, QR, parser limits). Standalone: test_local, test_filexfer, tests/p2p.sh and the UI pairing/message run pass with the changes. The in-tree build is pending because another release chain holds the lock (pid 4040149).
2026-11-17 06:49:35 +00:00
lotherk 79caf69db9 dtchat: fuzz the JSON and IRC parsers (T10.1)
fuzz.c is a deterministic harness: 1,000,000 iterations of random bytes, mutations of valid seeds, generated JSON (valid and broken) and IRC lines (long trailing, NULs, extra params). A parsed document is written and parsed again; an IRC result must have a command and at most 15 parameters; the splitter must finish. The input of iteration I depends only on the seed and I, so a crash reproduces with 'test_fuzz 1 SEED I'. Standalone: 1,000,000 iterations in 6.3 s; ASan/UBSan 1,000,000 clean (the only finding was the harness's own overlapping memcpy, fixed). Built test_fuzz 1M ok; make mcde-host exit=0; tools/mcde-tests.sh 31 ok/0 bad.
2026-11-17 06:42:04 +00:00
lotherk e9d8d9df4c dtchat: add the pairing SAS and the TOFU pin store (T5.4a)
pair.c derives the 6-digit SAS from both certificate pins (sorted, SHA-256, mod 1000000) so both sides compute the same code; peers.json keeps id -> pin and the blocked flag (0600, atomic store). dc_pins_check answers 1 for a known pin, 0 for an unknown id and -1 for a changed pin; only dc_pins_confirm stores a new pin after the person compared the SAS; a changed pin stays blocked until then. test_pair: known SAS answers (448183 for A+B, 500498 for A+A), order independence, malformed pins, empty store, confirm/check, changed pin, block persistence, save/reload. Standalone and ASan/UBSan clean. make mcde-host still blocked by pid 2126511.
2026-11-16 20:46:19 +00:00
lotherk dc44fc25a3 dtchat: add the headless peer mode (T5.7)
dtchat-headless starts the TLS listener (--listen [HOST:]PORT, port 0 prints the real port) and one reconnecting link per --peer, loads/creates the identity in --config, prints JSON events (ready, peer-online, peer-offline, message, typing, file-offer, error) and takes JSON commands on stdin (send by host:port or peer id, quit). dc_local_peer_conn() and the ack id let a link know its peer. tests/p2p.sh runs two instances over loopback: A listens, B connects, B sends, A answers by id, both quit; standalone run prints 'tests/p2p.sh: all ok'. Wired into noinst_PROGRAMS and mcde-tests.sh (expect 29 ok). make mcde-host still blocked by pid 2126511 (release/sourcesets/usb).
2026-11-16 20:43:06 +00:00
lotherk 7c8642298c dtchat: add local file transfer (T5.6)
filexfer.c offers name/size/sha256, sends 64 KiB chunks as base64 file-data lines and a file-end; the receiver writes NAME.part, enforces the 512 MiB limit, checks size and SHA-256 and renames to a sanitized name without overwriting. Cancel removes the part. Names take the basename, drop dot-dot and control characters. The local connection buffers grow to 128 KiB for one chunk per line; dc_local_conn_busy() lets the sender pace itself. test_filexfer: safe names, 1 MiB+12345 transfer with 64 KiB chunks and matching hash, oversized offer refused, cancel leaves no part file; standalone and ASan/UBSan clean; test_local still green. make mcde-host still blocked by the foreign release/sourcesets/usb chain (pid 2126511).
2026-11-16 20:39:37 +00:00
lotherk ce0b684613 dtchat: add the local text protocol and reconnect (T5.5)
local.c now has the client side of the peer protocol: dc_local_connect verifies that the server's hello-ack pin is the pin of the certificate it actually saw (and against the expected pin), sends our hello after the handshake, and has a 5 s hello-ack timeout. Ready connections exchange presence, msg, msg-ack and typing as JSON lines; the server and client dispatch input line by line from a shifted buffer. dc_local_peer_* wraps a client with 2, 4, 8 ... 60 s reconnect and online/offline callbacks. configure now requires libtls (the ADR does). test_local covers the three T5.4 pin cases, a full protocol round trip (msg -> ack, typing, presence) and a reconnect after the server restarts; standalone and ASan/UBSan clean. make mcde-host is still blocked by the foreign release chain (pid 2126511).
2026-11-16 20:35:47 +00:00
lotherk 3aab4e35c8 dtchat: add the local TLS listener and TOFU hello (T5.4)
local.c binds a nonblocking TLS listener (identity certificate, 127.0.0.1 or all interfaces, port 0 = ephemeral) and drives the handshake from DcLoop. A peer sends one JSON line {type:hello,id,pin}; the listener checks id and pin against what it expects, answers {type:hello-ack,ok:true|false,pin:...} and closes on a wrong pin, a lying or malformed hello. The accepted hello goes to the callback once; connections stay open for the protocol of T5.5. identity.c now also exposes the private key as PEM for libtls. test_local starts a listener per case and connects with a blocking libtls client: matching pin accepted (callback sees id/pin), wrong pin rejected (no callback, ok:false), any-pin accepted. Standalone test all ok; make mcde-host could not run because another agent's release+sourcesets+usb chain holds build/.build.lock (pid 2126511); the next build verifies the wiring.
2026-11-16 20:23:14 +00:00
lotherk 38304c4378 dtchat: add the local peer model (T5.3)
peers.c keeps one peer per identity id: the TXT record (v/id/name/pin/port, ';'-joined) merges by id and marks the peer online; a service that disappears is marked offline, a manual peer stays; blocking is a property that survives announcements. Strings are owned by the peer. test_peers covers announce/merge, port preference, offline per peer, block survival, manual peers and malformed records; built test all ok, make mcde-host exit=0, tools/mcde-tests.sh 26 ok/0 bad.
2026-11-16 19:50:16 +00:00
lotherk 027d797bf0 dtchat: add the Ed25519 identity and certificate (T5.1)
identity.c generates an Ed25519 key, a self-signed X.509 certificate (CN dtchat, ten years) and its SHA-256 pin; identity.json holds version/algo/public/private/cert/pin and is written atomically through the store (dir 0700, file 0600). Load verifies that the pin, the raw public key and the certificate match; a corrupt file is moved to .bad and load_or_create fails instead of replacing the identity. configure requires libcrypto and passes CRYPTOLIB. test_identity covers creation, modes, restart persistence, a second identity, and the corrupt-file path; the built test passes and tools/mcde-tests.sh is 25 ok/0 bad after make mcde-host exit=0.
2026-11-16 19:45:15 +00:00
lotherk 8665cab421 dtchat: IRC messages, splitting and the send bucket (T3.5)
Incoming PRIVMSG/NOTICE become text/notice messages, CTCP ACTION becomes an action message and direct messages open a direct conversation. dc_irc_split_next() splits at UTF-8 boundaries, prefers spaces and always breaks at newlines; the adapter budgets 512 bytes per PRIVMSG line. Sends go through a 128-line queue with a 4-message burst and 2 messages/s, pumped from the poll timeout. test_irc covers the splitter (ASCII, multibyte, over-wide character, newlines, empty); the fake-server test passes 19/19 with three chunks rejoining exactly, every line <= 512 bytes and a 0.50s max gap under flood. make mcde-host still blocked by pid 1207058.
2026-11-16 19:18:28 +00:00
lotherk 954bfc70bb dtchat: add the IRC line parser with tests (T3.2)
lib/libDtChat/irc.c parses IRCv3 tags, the prefix, the command, up to 15 parameters and the trailing text into a DcIrcMessage; NUL in the line, a missing command, more than 15 parameters and lines over 1 MiB are clean errors. test_irc covers PRIVMSG, tags+prefix, 001/005/353, PING, MODE, CAP, an empty trailing, repeated spaces, the error cases and 1 MiB of rubbish; all ok and ASan/UBSan clean. The IRC adapter now routes PING/001/ERROR/433 through the parser; the fake-server harness still passes 13/13. Added test_irc to tools/mcde-tests.sh. make mcde-host still held by another agent's sourcesets/usb build (pid 1207058).
2026-11-16 19:11:11 +00:00
lotherk b330b3b60a dtchat: add the generic account editor (T2.4)
ui_accounts.c builds the account list and a settings form from the adapter schema: text, secret, int, bool, choice, info and button. Secrets are collected into a separate JSON object and never shown; a modifyVerify callback keeps the masked text while the field stores the real value (this Motif has no XmNechoChar). Add/Delete create or remove accounts through dc_model_remove_account, Save validates required fields and numbers and updates the account label. Wired to File/Accounts... with a demo IRC schema. Standalone build clean; dialog opens on Xvfb, password masked, Save shows 'saved (demo)'; test_conv and ASan/UBSan green. make mcde-host could not run: another agent's release build holds build/.build.lock (pid 175328).
2026-11-16 18:42:58 +00:00
lotherk 8911994262 dtchat: bind the roster to the model (T2.2)
DcPresence on DcConv (offline default, online/away/dnd); the roster lists accounts and conversations with presence marks and unread counts, 45 demo rooms make it scroll, selection sets the title/topic, fills the transcript from the 2000-message ring and clears unread. The demo model lives in main.c; --smoke-test selects jabber/bob@example.org and checks viewable, selection, transcript and unread==0. make mcde-host exit=0; built smoke PASS; test_conv all ok; screenshot build/mcde-shots/dtchat-t22.png; PSS 5.6 MB.
2026-11-16 18:27:40 +00:00
lotherk fa6b5cdfa4 dtchat: enforce the adapter hello timeout
A child that does not send hello within 10 s is killed; the normal restart backoff applies. Aligns adapter.c with the v1 protocol document.
2026-11-16 17:49:11 +00:00
lotherk 581735f013 dtchat: add the single-instance lock and control socket (T1.6)
instance.c: DIR/run 0700, dtchat.lock 0600 with flock(LOCK_EX|LOCK_NB), primary Unix listener at dtchat.sock 0600, one open request per client with a 2 s timeout, non-primary instance plus dc_instance_notify with connect retries, and socket/lock cleanup on close. test_instance covers primary/secondary, modes, open callback, malformed client, notify after close and re-acquisition. make mcde-host exit=0; all eight dtchat tests 'all ok'; ASan/UBSan clean. SIGPIPE is ignored so a dead local client cannot kill the core.
2026-11-16 17:45:58 +00:00
lotherk e162ba645d dtchat: add the adapter process manager (T1.5)
adapter.c spawns a helper, waits for hello (ipc 1), sends configure/connect, routes events, drains stderr, buffers stdin, reaps zombies and restarts with 2..60 s backoff unless the child said bye. fake_adapter.c and test_adapter.c cover normal handshake, send/message echo, join/answer, stop/bye, crash restart and invalid JSON. make mcde-host exit=0; test_adapter 'all ok'; ASan/UBSan clean. test_adapter_DEPENDENCIES now includes libDtChat/libDtChatIpc to avoid the parallel relink race.
2026-11-16 17:35:28 +00:00
lotherk 83741ce6eb dtchat: add the conversation model and text helpers (T1.4)
conv.c: accounts, conversations, topics, idempotent add, a 2000-message ring buffer and unread counts that ignore our own/system messages. text.c: UTF-8 validation, C0 cleaning, mIRC formatting strip and iconv display with ASCII//TRANSLIT and '?' fallbacks. test_conv and test_text cover duplicate adds, ordering, the ring boundary, flags/unread, IRC codes, CR/CRLF and ISO-8859-1/ASCII output. make mcde-host exit=0; all six dtchat tests report 'all ok'; ASan/UBSan clean.
2026-11-16 17:18:12 +00:00
lotherk 82ab2cb4b5 dtchat: add the atomic state store (T1.3)
store.c keeps accounts.json, secrets.json and identity.json in a 0700 directory with 0600 files, writes through a temporary file with fsync/rename/dir-fsync, repairs a wrong file mode on load, moves invalid JSON to NAME.bad and rejects path names. test_store covers accounts/secrets/identity, overwrite, corrupt/missing files, stale tmp, read-only directory, default HOME path and permissions. make mcde-host exit=0; test_json, test_frame, test_loop and test_store all ok; ASan/UBSan clean.
2026-11-16 17:09:27 +00:00
lotherk 4e97d5930d dtchat: add the poll and timer event loop (T1.2)
loop.c: one poll(2) per run, monotonic one-shot timers (sorted, FIFO on equal deadlines), non-blocking wakeup pipe and safe fd dispatch when a callback removes another fd. test_loop covers timer order/cancel, timeout, wakeup, pipe, delete-in-callback, timer-added-timer, monotonicity and invalid arguments. make mcde-host exit=0; test_json, test_frame and test_loop all ok.
2026-11-16 17:00:50 +00:00
lotherk 7dbaad5afa dtchat: build the IPC tests with mcde-host (T1.1)
test_json and test_frame are noinst_PROGRAMS so the native build produces them for tools/mcde-tests.sh; TESTS still runs them under make check.
2026-11-16 16:45:22 +00:00
lotherk ffb067372b dtchat: fail cleanly on a zero-byte frame write
dc_frame_send now returns -1 instead of looping when write(2) returns 0 for the payload or the trailing newline.
2026-11-16 16:38:50 +00:00
lotherk e645e8160d dtchat: add the core API, JSON reader and line framing (T1.1)
include/DtChat/DtChat.h and Ipc.h define the UI-facing core API and the adapter contract. lib/libDtChat builds libDtChatIpc (strict JSON parser/writer, 1 MiB line framing) and the libDtChat core stub; test_json and test_frame cover escapes, UTF-8, depth 32, duplicate keys, overlong lines, CRLF, NUL and the write path. Wired into configure.ac, lib/Makefile.am and the installed headers. Standalone tests pass, ASan/UBSan clean.
2026-11-16 16:35:48 +00:00
lotherk f4ec4a1da1 MCDE: the disk-removed warning through the kernel's device events (t0093)
A medium that is pulled while it is still mounted now gets the reference's
one-button "Disk Not Ejected" warning: Motif's error dialog, the device and
its stale mountpoint in the text, the Warning sound.  The desktop (dtwm,
WmMcdeDesktop.c) owns the event descriptor already; it reads each event,
asks what it says, and checks the mount table before it shows anything.

McdeSys:
- mcde_sys_disk_event_info() parses both shapes the read gives: Linux's
  uevent with its NULs turned into spaces ("remove@/... ACTION=remove
  DEVNAME=sdb1 ...") and NetBSD's "device-detach sd0"; 1 when the device
  went away, 0 for add/change/attach, -1 on bad arguments.
- mcde_sys_disk_detached(name, mountpoint, len): looks in the mount table
  for a partition of NAME (sdb takes sdb1, sd0 takes sd0a), copies the
  mountpoint and unmounts it the forced way -- "umount -l" on Linux,
  "umount -f" on NetBSD (disk_linux.c, disk_netbsd.c) -- but never what the
  computer runs from.  0 when nothing of NAME was mounted.
- test_disk_events.c: the uevent and drvctl shapes, add/change/attach,
  missing DEVNAME, the bad arguments.  make check: 8/8 PASS (the seven
  before and this one).

Measured under Xvfb :79 with a real ext4 loop mount at /tmp/opencode/mnt:
- start of dtwm with MCDE_DESK_TEST_DEVICE="remove@/... DEVNAME=loop0":
  log "desktop: loop0 (remove)", "umount: /tmp/opencode/mnt: must be
  superuser to unmount.", "desktop: loop0 was mounted at
  /tmp/opencode/mnt"; the dialog is 354x167 at (335,300), OK as the only
  button (docs/screenshots/leopard/Device-Removal-mcde.png).
- sudo umount /tmp/opencode/mnt, the same event again: log "desktop: loop0
  (remove)" and no "was mounted"; zero dialog windows -- a device that was
  put away stays quiet.
- make mcde-linux MCDE_DIRS="install lib/McdeSys programs/dtwm" exit=0;
  MCDE_DIRS=plist "mcde-plist-check: ok".

MCDE_DESK_TEST_DEVICE is the test hook: one event line through the same
handler a real event takes, without a kernel.  The NetBSD drvctl branch is
unchanged (t0272); the force unmount there is written for it but was not
run.  Still open in t0093: the Eject item in dtfile (Selected menu,
Command+E) and the qemu device_del test in a VM.
2026-11-16 13:56:06 +00:00
lotherk df81373057 MCDE: the WEB_URL data type and the hanging test_sysload child (t0303)
A .url file is a WEB_URL now (the reference sdturl.dt): a text file
whose content is a URL, ACTIONS McdeWeb,Print, ICON Dtdata,
NAME_TEMPLATE %s.url, MIME text/x-url.  Measured in dtfile: test.url
shows the URL icon beside note.txt (screenshot).

test_sysload: the child that waits for a signal sets alarm(60), so a
hung or killed test no longer leaves it in pause() and blocks the
build lock with waitpid.
2026-11-16 13:04:42 +00:00
lotherk ff3e93ee10 McdeSys: the NetBSD disk and mount errors in the catalog (t0282)
disk_netbsd.c (16 calls) and mount_netbsd.c (2) are catalogued now: messages
218-233 for the new sentences (no hw.disknames, a %s partition cannot be
mounted/checked, no %s here, the name rule with blanks and 32 characters, the
new partition did not appear, no /etc/mtree, repairing permissions needs the
administrator, no mount table) and the numbers that already existed for the
same texts as on Linux (no disk %s, not mounted, the system's, erasing needs
the administrator, no drive, holds the system, mounted on, no room for the
mounts).  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

Verification: both files pass
x86_64--netbsd-gcc -std=gnu11 -fsyntax-only -Wall with the tree's sysroot
(they are only compiled on NetBSD).  The catalog was measured through
mcde_sys_msg (the function the backend calls): LANG=C "No list of disks
(hw.disknames).", "A name has letters, digits, blanks, - and _, at most 32.",
"Only the administrator can repair permissions."; LANG=de_DE.UTF-8 "Keine
Plattenliste (hw.disknames).", "Ein Name hat Buchstaben, Ziffern, Leerzeichen,
- und _, höchstens 32.", "Nur der Administrator kann die Rechte reparieren."

make mcde-linux was refused by the build lock: another session holds it
(tools/build-lock.sh tools/userland.sh, pid 3102819) -- one build at a time,
root AGENTS.md.  The two changed sources are NetBSD-only, so the Linux
library is unaffected; the Linux build, check and plist run follows when the
lock is free.
2026-11-16 12:12:39 +00:00
lotherk 5f1d166ac8 McdeSys: net, logs and the Linux disk/mount errors in the catalog (t0282)
net.c (11 calls), logs.c (9), disk_linux.c (13) and mount_linux.c (1) are
messages 187-217 of mcdesys.cat now: no interfaces, no card of that name,
the network-settings administrator sentence, the address checks (IPv4,
subnet mask, router, IPv6 with prefix, DNS, domain), the DHCP client ID
rule; the log sentences (no room, no name, inotify missing, cannot be
watched/read, kqueue is a follow-up on this system, no buffer); the disk
sentence set (lsblk/udisksctl missing, no such disk, not mounted, the
system's, cannot be checked, erasing needs the administrator, the name rule,
no drive, holds the system, mounted on, no permissions list); "No
/proc/mounts."  German copy with the same numbers in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls): LANG=C "Only the
administrator can change the network settings: click the lock first." and
"This log cannot be read."; LANG=de_DE.UTF-8 "Nur der Administrator kann die
Netzwerkeinstellungen ändern: zuerst entsperren." and "Dieses Log kann nicht
gelesen werden."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 12:09:36 +00:00
lotherk 777bd7c8e6 McdeSys: netbsd.c in the catalog, German measured (t0282)
The NetBSD backend's 79 mcde_sys_fail calls are catalogued now: 43 new
messages (144-186) for its own sentences plus the numbers that already
existed for the same texts (cannot write, out of memory, no such service,
the administrator sentences, no account, no network card, the comments, the
lock as set/clear two messages, unknown power action).  The new ones: did
not start, count/list the processes, ntp.conf and /etc/myname, read/read with
strerror, beside a file, the touchpad administrator/no touchpad/setting could
not be written, DRVGETEVENT, PKG_PATH, salt, the update source (not set, does
not answer, not allowed), the Wi-Fi scan/renew administrator sentences,
secure virtual memory, mdnsd, processes change too fast, outputs.master, the
Wi-Fi name/password rule, hashing, the server not installed (with a name),
swap encryption unknown/sysctl, the system's CPU times/disk counters/
interfaces/memory/number of processors, no place for state/value, cgd, npf,
too many settings, dhcpcd renew/start.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

netbsd.c is not compiled on this Linux host: it passes
x86_64--netbsd-gcc -std=gnu11 -fsyntax-only -Wall with the tree's sysroot.
The catalog itself was measured through mcde_sys_msg (the function the
backend calls), LANG=C vs LANG=de_DE.UTF-8:
154 "Changing the touchpad needs the administrator." / "Das Touchpad zu
ändern braucht den Administrator.",
165 "... (a password has 8 to 63 characters, no quotes)." / "... (ein
Passwort hat 8 bis 63 Zeichen, keine Anführungszeichen).",
176 "The update source is not allowed: ..." / "Die Update-Quelle ist nicht
erlaubt: ...".
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:57:25 +00:00
lotherk 8d129c56c4 McdeSys: the rest of linux.c in the catalog, German measured (t0282)
linux.c's remaining sentences are messages 107-143 of mcdesys.cat now (the
NetworkManager block was 98-106): unknown power action, no sound server and
no mixer / the mixer tells no volume / no mixer, bluetoothctl missing, the
touchpad settings are outside the desktop, the password/change/update/service
administrator sentences, apt-get cannot tell what is new, cannot read /proc,
the file system keeps no comments / no lock, read/remove/write the comment,
cannot open a file, set/clear the lock (two messages, the word is not a
parameter any more), cannot write /etc/hostname, no hostname tool,
timedatectl is not installed, no such service, the server is not installed,
avahi-browse missing, secure virtual memory / cgd / npf are NetBSD's,
/proc/stat, /proc/meminfo, /proc/net/dev, /proc/diskstats and the kernel
event socket cannot be read, the two "tells no processor/memory" sentences.
German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls): LANG=C "Cannot
write /etc/hostname: Permission denied." and "Only the administrator can
switch a service."; LANG=de_DE.UTF-8 "/etc/hostname kann nicht geschrieben
werden: Keine Berechtigung." and "Nur der Administrator kann einen Dienst
umschalten."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:48:04 +00:00
lotherk 086189b68f McdeSys: linux.c's network errors in the catalog, German measured (t0282)
The NetworkManager block of linux.c is messages 98-106 of mcdesys.cat now:
nmcli not there / not installed (the settings cannot be changed here), only
the administrator can join a Wi-Fi network, the network name cannot be used,
NetworkManager has no settings for a card, nmcli does not tell the settings
of a connection, NetworkManager did not take the settings or could not bring
a connection up again, there is no network card of that name.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls):
LANG=C: "Only the administrator can join a Wi-Fi network." and
"NetworkManager has no settings for nosuchcard0."; LANG=de_DE.UTF-8: "Nur der
Administrator kann einem WLAN beitreten." and "NetworkManager hat keine
Einstellungen für nosuchcard0."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:38:54 +00:00
lotherk e0ab05b677 McdeSys: common.c's remaining errors in the catalog, German measured (t0282)
The rest of common.c's sentences are messages 74-97 of mcdesys.cat now: the
exec failure line, no host name, no time zone list, no such time zone, the
administrator for the time zone, cannot link, cannot replace (the same text
as message 59, reused), no command line for a process, no room for the CPU
times / memory / network counters / disk counters / process list, that is no
process to signal, the process belongs to somebody else, it is gone, cannot
signal it, no file (and no room) for the comment, no file for the lock, no
name a computer can take, no place for the time service state, cannot set the
clock.  German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls): LANG=C
"\"bad name!\" is not a name a computer can take.", "There is no time zone
\"No/Such\".", "No place for the list of processes."; LANG=de_DE.UTF-8
"\"bad name!\" ist kein Name, den ein Rechner annehmen kann.", "Es gibt keine
Zeitzone \"No/Such\".", "Kein Platz für die Prozessliste."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:26:21 +00:00
lotherk 893313c873 McdeSys: the device event and mount errors in the catalog (t0282)
events.c's five and mount.c's one mcde_sys_fail calls are messages 68-73 of
mcdesys.cat now: the kernel's event socket cannot be opened or bound, cannot
open /dev/drvctl (is the drvctl pseudo-device configured?), device events
have no source on this system, no room for the event, no room for the
mounts.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

Measured with a runner (setlocale + mcde_sys_disk_event_read(-1, ...) and
mcde_sys_mounts(m, 0)): LANG=C "No room for the event." / "No room for the
mounts."; LANG=de_DE.UTF-8 "Kein Platz für das Ereignis." / "Kein Platz für
die Einhängepunkte."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:20:15 +00:00
lotherk a584ad9c45 McdeSys: the sharing and account errors in the catalog (t0282)
share.c's seven and users.c's six mcde_sys_fail calls are messages 57-67 of
mcdesys.cat now: cannot write beside/into a file, cannot replace, only the
administrator can change what is shared, no folder that can be shared; no
name for an account, an account exists already, a name has no colon, only the
administrator can add/delete an account (unlock first), no such account.  The
German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg keeps the
numbers.

Measured with a runner (setlocale + mcde_sys_shares_set on a missing folder,
mcde_sys_user_delete on a missing login): LANG=C "Only the administrator can
change what is shared." and "There is no account \"nosuchuser_xyz\".";
LANG=de_DE.UTF-8 "Nur der Administrator kann ändern, was freigegeben ist."
and "Es gibt kein Konto \"nosuchuser_xyz\"."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:12:31 +00:00
lotherk b674c3d2b7 McdeSys: the printer errors in the catalog, German measured (t0282)
printers.c's eighteen mcde_sys_fail calls are messages 43-56 of mcdesys.cat
now: no place for the printers, no CUPS (lpstat/lpadmin), CUPS did not answer
or did not take the default printer/the printer/the removal, no printer was
named, the default printer / adding / removing needs the administrator, the
printer's name and address must be plain, no mDNS browser and the browser did
not answer.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg with the same numbers.

Measured with a runner (setlocale + the public calls):
LANG=C: "The printer's name and address must be plain (letters, digits, - and
_; ipp://...)." and "No printer was named."; LANG=de_DE.UTF-8: "Name und
Adresse des Druckers müssen schlicht sein (...)" and "Es wurde kein Drucker
genannt."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 11:05:42 +00:00
lotherk 22aaaa5d84 McdeSys: the sound errors in the catalog, German measured (t0282)
sound.c's four error sentences are messages 39-42 of mcdesys.cat: the sound
server tells no volume, there is no sound file "%s", no player is installed,
cannot start %s.  The German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg keeps the numbers.

Measured with a runner (setlocale + mcde_sys_sound_play on a missing file):
LANG=C "There is no sound file \"/nonexistent/ding.wav\"."; LANG=de_DE.UTF-8
"Es gibt keine Tondatei \"/nonexistent/ding.wav\"."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 10:59:19 +00:00
lotherk dcee228451 McdeSys: the backup errors in the catalog, German measured (t0282)
backup.c's 23 mcde_sys_fail calls are messages 22-38 of mcdesys.cat now:
cannot write, the backup disk mounted somewhere else, the six
administrator sentences (set up, change, switch, back up, look into,
restore), BorgBackup missing, password too short, choose a disk, bad numbers,
crontab/dtbackup missing, no disk set up, nothing to restore, cannot go to.
The German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg uses the
same numbers; these texts are shown in System Settings (Xft), so they carry
proper umlauts.

Measured with a runner (setlocale + the public calls):
LANG=C: "Only the administrator can set up the backup.", "Only the
administrator can switch the backup.", "Only the administrator can restore
from the backups."; LANG=de_DE.UTF-8: "Nur der Administrator kann die
Sicherung einrichten.", "... die Sicherung umschalten.", "... aus den
Sicherungen wiederherstellen."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": FAIL 0, exit=0;
MCDE_DIRS=plist: ok.
2026-11-16 10:52:58 +00:00
lotherk 7507b51850 McdeSys: the network mount errors in the catalog, German measured (t0282)
netmount.c's twelve sentences are messages 10-21 of mcdesys.cat now: no
computer name, showmount/smbclient/sshfs/mount_afp/NFS/umount not there, no
list of shares for that kind, no address this computer can connect to, a
password that cannot be used, a scheme that is not there yet, no folder.
The German copy in programs/localized/de_DE.UTF-8/msg/mcdesys.msg keeps the
same numbers (ASCII in these low-level texts: they also reach programs
without a render table).

Measured with a small runner (setlocale + the public calls):
LANG=C: "bogus:// cannot be connected to here yet.",
"\"smb://bad host/share\" is no address this computer can connect to.",
"No folder."; LANG=de_DE.UTF-8 (localedef/LOCPATH): "bogus:// kann hier noch
nicht verbunden werden.", "\"smb://bad host/share\" ist keine Adresse, zu
der dieser Rechner verbinden kann.", "Kein Ordner."
make mcde-linux MCDE_DIRS="install lib/McdeSys", "install
programs/localized/C/msg" and "check lib/McdeSys" exit=0; MCDE_DIRS=plist:
"3487 installed names under dt/, 8682 in the PLISTs", ok.
2026-11-16 10:46:34 +00:00
lotherk e6202a8019 McdeSys: the tool errors come from a catalog, German measured (t0282)
common.c's tool runner built its sentences as format strings, so every
dialog that shows mcde_sys_error() was English.  They are set 1 of
lib/McdeSys/mcdesys.msg now (9 messages: not there, cannot start, failed
with status, no pipe, no answer within N seconds, out of memory, the program
is not installed, the connector ended without an answer, cancelled), read by
lib/McdeSys/text.c (mcde_sys_msg, plain catopen/catgets; NLSPATH is set the
way DtSvc does when the session has none, from -DMCDE_DT_TOP=$(prefix)).
The German copy is programs/localized/de_DE.UTF-8/msg/mcdesys.msg, built by
msg.C.am into lib/nls/msg and listed in the PLIST (C plain, ${PLIST.nls} for
German).  A library does not call setlocale; the program does.

mcdesoundd gets no catalog: its only text is the log of a background daemon,
and the system layer stays English (AGENTS.md, language point 6).

Measured: a small program (setlocale + mcde_sys_run) prints
"/nonexistent/tool is not there." and "/bin/false did not succeed
(status 1)." with LANG=C, and "/nonexistent/tool ist nicht vorhanden." /
"/bin/false war nicht erfolgreich (Status 1)." with LANG=de_DE.UTF-8
(localedef/LOCPATH).  make mcde-linux MCDE_DIRS="install lib/McdeSys" and
"install programs/localized/C/msg" exit=0; MCDE_DIRS=plist: "3487 installed
names under dt/, 8682 in the PLISTs", ok.
2026-11-16 10:38:43 +00:00
lotherk b61e22457f MCDE mouse pane: wheel labels unswapped, touchpad settings (t0288)
Konrad, 2026-11-16: scrolling looked inverted in the settings, and the
touchpad could not be configured (three buttons or two with taps/gestures).

- The wheel radio pair had its texts swapped: without the button 4/5 swap a
  wheel turned towards you sends button 5 and the content goes down, so that
  is the "towards you" state.  The labels now sit on the right widgets.
- McdeSys gains mcde_sys_touchpad_get/set (McdeSys.h): tap to click, two
  fingers as no/right/middle button (pms(4) hw.synaptics.tap_to_click and
  .two_fingers_emulation) and a scrolling strip at the pad's edge
  (.vert_scroll_percent/.horizontal_scroll_percent, 7 or 0).  The sysctls are
  CTLFLAG_READWRITE, so a write as a user answers MCDE_SYS_EPERM with a
  sentence; a system without the interface answers ENOTSUP (Linux: libinput
  keeps its own, per device).
- The Mouse tab builds a Touchpad section from the read values (tap, the
  pad's own buttons / right / middle, the scrolling strip) and writes
  ~/.dt/touchpad only after a successful set; the note says when the
  administrator is needed.  dtsystemsettings -apply-touchpad puts the saved
  values back, for a boot script or an unlocked session.

Measured: make mcde-linux MCDE_DIRS="install lib/McdeSys" and
"install programs/dtsystemsettings" exit=0; the NetBSD branch of netbsd.c
passes x86_64--netbsd-gcc -std=gnu11 -fsyntax-only -Wall with the tree's
sysroot; the Mouse tab on Linux shows the corrected wheel pair and "This
system keeps the touchpad settings outside the desktop" (screenshot), and
with a stub backend in the build tree only for the picture, the section with
tap, fingers and strip; dtsystemsettings -apply-touchpad with a saved file on
Linux answers the ENOTSUP sentence, rc=1; with no file rc=0.
2026-11-16 09:14:44 +00:00
lotherk d2ada23e5a McdeSys: device events on NetBSD through drvctl(4) DRVGETEVENT
mcde_sys_disk_events() opens /dev/drvctl O_NONBLOCK on NetBSD; the
events come as an ioctl, not read(2), so the new
mcde_sys_disk_event_read() is the one call a program uses: Linux reads
the uevent, NetBSD asks DRVGETEVENT and turns the property list into the
same 'device-attach sd0' line (the way devpubd(8) does it).  dtwm's
desktop and test_sysinfo use the new call; the cross compiler builds
events.c and netbsd.c for NetBSD and the Linux tests stay green.
2026-11-16 07:25:28 +00:00
lotherk 0977cc954a MCDE: desktop icons for computer, disk mounts, media and network mounts
McdeSys: McdeSysMount and mcde_sys_mounts() -- /proc/mounts on Linux
(label from /dev/disk/by-label, removable from /sys/block), getmntinfo
on NetBSD; pseudo file systems are marked volume=0, network file systems
network=1; test_sysinfo checks that / is mounted once.

dtwm: WmMcdeDesktop.c is the 4Dwm-style desktop: one override-redirect
window per icon in the top right corner, filled from the top down, then
the next column left; XPM glyphs; labels cut with '...'; the computer
('/'), disk mounts, removable media (mounted or not), network mounts and
the person's files from ~/.dt/Desktop and ~/Desktop; right click menu
(Open, Open Home, Show on All/This Workspace, Unmount, Move to Trash);
drag and drop; every icon's place and workspace in ~/.dt/desktop.conf
(kept for good); not mounted media are mounted by the double click.
WmWrkspace.c calls McdeDesktopWorkspaceChanged() on a workspace change.

tools/mcde-shot.sh: MCDE_DESK_TEST_MOUNTS, MCDE_DESK_TEST_DISKS,
MCDE_DESK_TEST_DESKTOP and MCDE_SHOT_KEEP_HOME for the tests.
2026-11-15 22:22:20 +00:00
lotherkandClaude Sonnet 5.5 6676102ec8 McdeSys: network and disk counters for the activity window (t0091, McdeSys part 2)
mcde_sys_net_io: bytes and packets each way, for each interface (the loopback
too).  mcde_sys_disk_io: bytes and operations read and written, for each whole
disk (no partitions; no loop, ram or zram devices).  The difference of two
readings over the seconds between them is the rate the Network and Disk
Activity tabs draw.

NetBSD (read in the tree first): the interface counters are the struct if_data
of the link-level address from getifaddrs(3) (ifi_ibytes, ifi_obytes,
ifi_ipackets, ifi_opackets); the disks come from sysctl hw.iostats
{CTL_HW, HW_IOSTATS, sizeof(struct io_sysctl)}, asked for its size and then for
the array (usr.bin/vmstat/drvstats.c:183-188, :323-328), type IOSTAT_DISK,
rbytes/wbytes/rxfer/wxfer (sys/sys/iostat.h).  Cross-compiled with
x86_64--netbsd-gcc -Wall -Wextra: no diagnostic.  NEVER RUN on NetBSD.
Linux: /proc/net/dev (64-bit counters), /proc/diskstats (512-byte sectors),
whole disks only: those with a directory in /sys/block.

test_sysload (make check, 7 of 7) now also: 2 MB sent over a TCP connection on
127.0.0.1 raise the loopback's rx and tx bytes by at least 2,000,000 and its
packets; 8 MB written and fsync'ed next to the test move the disks' write
counters (measured here: 25,595,904 bytes for 8 MB -- the device-mapper volume
and the physical disk under it are both whole devices, so a window should not
add them up); the counters never go back by name; the write check says SKIP
instead of failing where the file system has no disk.  Mutants: rx bytes taken
from packets fails 2 checks, write bytes taken from the read sectors fails 1,
sectors not multiplied by 512 fails 1.

Not done of t0091: the program (programs/dtactivity).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 05:03:08 +00:00
lotherkandClaude Sonnet 5.5 ecef3334a2 McdeSys: CPU times, memory and signals for the activity window (t0091, McdeSys part)
mcde_sys_cpu_times: one McdeSysCpu (user, nice, system, idle, other ticks since
boot) per processor.  mcde_sys_memory: bytes, total = free + cached + used (cached
is what the system gives back when asked), and swap.  mcde_sys_signal: TERM, KILL,
STOP, CONT, HUP or INT to a process above pid 1 -- never init, a group or "all my
processes" (kill(2) with 0 or a negative number is refused before it is asked);
EPERM for another user's process, ENOENT for one that is gone.

Backends, read in the tree before they were written:
- NetBSD: kern.cp_time given room for every CPU (hw.ncpu x CPUSTATES x 8 bytes)
  returns each CPU's counters in CP_ order (sys/kern/init_sysctl.c,
  sysctl_kern_cptime: "alternately, you can pass an additional mib number and get
  cp_time for that particular processor"; a buffer of one CPU's size gets the
  SUM); memory from vm.uvmexp2 (struct uvmexp_sysctl, pages; top(1) reads it
  too, external/bsd/top/dist/machine/m_netbsd.c).  Cross-compiled with
  x86_64--netbsd-gcc -Wall -Wextra: no diagnostic.  NEVER RUN on NetBSD.
- Linux: /proc/stat (cpuN lines, "other" = iowait + irq + softirq + steal),
  /proc/meminfo (cached = MemAvailable - MemFree, else Buffers + Cached).

test_sysload (make check, 7 of 7): the memory adds up and agrees with
sysconf(_SC_PHYS_PAGES) within 5 per cent; the CPU counters never go down and
0.4 s of work of the test's own shows as at least 5 ticks; children are stopped
(state T in mcde_sys_processes), continued and ended by TERM, KILL, HUP and INT
(the exit status says which signal); pid 1, 0, -1, a group and a bad signal are
refused; a waited-for child is "gone"; another user's process answers EPERM (to
SIGCONT only, and only when the test is not run by root).  Mutants: memory
without the x1024 fails 2 checks, a parser that loses the busy ticks fails 1.
Not checkable on a busy host: that user, nice, system and idle are not swapped
(the shares depend on the load); the NetBSD backends are not run.

Not done of t0091: mcde_sys_disk_io and mcde_sys_net_io (the Disk Activity and
Network tabs), and the program itself.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 05:00:36 +00:00
lotherkandClaude Sonnet 5.5 c7b9bcd0ae McdeSys: a Wi-Fi name that starts with "-" is no argument for nmcli (t0081)
The Linux mcde_sys_wifi_join passes the network name to
"nmcli device wifi connect NAME ...".  The name of an access point is what the
neighbour's device broadcasts.  Measured with nmcli 1.56.1:
  nmcli device wifi connect --ask password PW ifname IF
  -> "Error: invalid extra argument 'PW'" -- the name was taken as the option
  --ask (a name of -x, --help or - is taken as a name; no effect).
"--" in front is no remedy: nmcli takes the "--" for the name ("invalid extra
argument 'Home'" for a normal name).  The password is safe: it is the argument
of the keyword "password" whatever it starts with.

So the Linux branch refuses a name that starts with "-" (mcde_sys_wifi_ssid_arg_ok
in net.c, with the old 1..32 byte rule); the NetBSD branch does not call nmcli.
A legitimate network called "-something" cannot be joined from System Settings
on Linux; the message is the old one ("The network name cannot be used").
test_netinput: 11 more checks; make check 6 of 6; with the dash rule removed the
test fails (checked with a mutant).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 04:56:03 +00:00
lotherkandClaude Sonnet 5.5 378a6bc805 McdeSys: an AFP password no longer shows in ps(1) (t0077, A)
mcde_sys_net_mount built afp://user:PASSWORD@host/vol and that was argv[1] of
mount_afp: everyone on the computer could read it with ps(1) for as long as the
mount ran (measured with a fake mount_afp and a slow tool: "mount_afp
afp://alice:TopSecret-42@nas.local/Volume /tmp/mp-test").  The address says
"-" now, and the password is one line of the tool's standard input:
afpfs-ng's mount_afp asks getpass(3) for a password "-" (fuse/client.c), and
getpass reads the standard input where the process has no controlling terminal
(src/lib/libc/gen/getpass.c:106-112: "Try to use /dev/tty if possible;
otherwise read from stdin").  So no change in the fork.

For that the tool must have no controlling terminal even when the program was
started from a terminal: the job runner is a session of its own now (setsid
instead of setpgid; the group is still the runner's, cancelling still ends the
tool; kill of the pid too, for the moment before the setsid), and
mcde_sys_net_mount is _start plus waiting, so it detaches the same way.  The
restriction against "@", "/" and ":" in an AFP password is gone (they were in the
address); a line break or more than 297 characters is refused for sshfs and
mount_afp alike.

Measured with the fake mount_afp (records argv, whether /dev/tty opens, what
getpass returns): argv[1] afp://alice:-@nas.local/Volume, getpass returned the
password, also "pa:ss@w/rd 1"; under a pseudo-terminal the OLD code kept
"controlling terminal present" and the new one has "no controlling terminal"
and still gets the password; no password -> afp://alice@nas.local/Volume, no
getpass; a line break -> refused.  ps during a mount: old code showed the
password in mount_afp's line, new code "-".  test_netmount: 6 cases of
mcde_sys_net_afp_address (a function that is not given the password, so it
cannot put it into the address); make check 6 of 6 (test_job's cancel test still
passes); the dtfile timeout/Escape scenario still leaves 0 tool processes.

Not done of t0077: B (the /tmp/afp_server-<uid> socket and /tmp/fuse_stderr of
afpfs-ng), and the real mount_afp against a netatalk server (the fake stands
in; only the standard-input and argv behaviour is measured).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 04:45:29 +00:00
lotherkandClaude Sonnet 5.5 5b2f0f4e8e McdeSys: the Wi-Fi input checks are a function the tests can reach (t0081, a)
The checks that keep a typed network name and password out of
wpa_supplicant.conf and rc.conf (netbsd.c, mcde_sys_wifi_join) sat inline in
the NetBSD branch, behind geteuid() != 0: no test of the build could run them.
They are mcde_sys_wifi_config_ok in net.c now (one implementation for the file
that is built on every system), the NetBSD branch calls it, and the new
test_netinput.c runs 46 checks as an ordinary user: name 1..32 bytes (33
refused), passphrase none or 8..63 (7 and 64 refused), a quote, a backslash or
a newline in either (also a whole injected "network={" block), the interface
name (lower case and digits only), plus the two helpers net.c already had
without a test: mcde_sys_net_ifname_ok and mcde_sys_net_prefix (a
non-contiguous netmask, trailing text).

One behaviour change, found by writing the table: an EMPTY interface name
passed the inline check (strspn("") == strlen("")) and would have given
wpa_supplicant_flags="-B -s -i  -D bsd ..."; it is refused now.

Measured: make check 6 of 6.  Mutation check: with the SSID limit raised to 33,
with the empty-name guard removed, with the passphrase minimum 7, and with the
quote check left out of the passphrase, test_netinput fails (1, 1, 1 and 2
cases); the real code passes.  netbsd.c and net.c compile for NetBSD
(x86_64--netbsd-gcc) without a diagnostic.  Not run on NetBSD.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:24:54 +00:00
lotherkandClaude Sonnet 5.5 b2dab1ad71 McdeSys: no fixed /usr/pkg in the sources; configure says where pkgsrc is (t0081, c)
19 paths in lib/McdeSys (borg, dtbackup, pactl, paplay, smbclient, sshfs,
mount_afp, lpstat, lpadmin, avahi-browse, sysupgrade, smbd, netatalk, atalkd,
the rc.d examples, smb.conf, afp.conf) were written as "/usr/pkg/...".  They
are MCDE_PKG_PREFIX "/bin/borg" and MCDE_PKG_SYSCONFDIR "/afp.conf" now:
configure.ac has --with-pkg-prefix (default /usr/pkg) and --with-pkg-sysconfdir
(default PREFIX/etc), lib/McdeSys/Makefile.am hands them to the library as
-D, and the recipe passes --with-pkg-prefix=${PREFIX} and
--with-pkg-sysconfdir=${PKG_SYSCONFDIR} (the same way --with-local-bindir is
passed).  The sources do not include config.h, hence the -D.

Measured: x86_64--netbsd-gcc -S of backup, netbsd, sound, netmount and printers
before and after: the string constants are byte-identical (490 strings, the same
17 distinct /usr/pkg paths).  With -DMCDE_PKG_PREFIX=/opt/pk and
-DMCDE_PKG_SYSCONFDIR=/etc/pk: no /usr/pkg left, 15 paths under /opt/pk, the two
configuration paths under /etc/pk.  Native: configure regenerated, the
Makefile has MCDE_PKG_PREFIX = /usr/pkg, make check 5 of 5, PLIST pre-check
ok (3208 installed names, 8396 in the PLISTs).  git grep '"/usr/pkg' in
lib/McdeSys: nothing.

Not done of t0081: the message catalogs; the wifi_join checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 01:21:33 +00:00
lotherkandClaude Sonnet 5.5 bd41face71 McdeSys: an sftp user that starts with "-" no longer reaches sshfs as an option (t0081, tests)
ParseUrl refused a host that starts with "-" but not a user: the first argument
of sshfs is "USER@HOST:PATH", so sftp://-p22@host/ gave it "-p22@host:/", an
option.  Found by the table test this commit adds: mcde_sys_net_url_ok (the
tests' view of ParseUrl, private.h) with 22 addresses -- sftp/nfs/afp, IPv6
written bare, an empty user, a user or host that is an option, a space, ';',
'$(id)', a second '@', a newline in the path, no host, no scheme, a scheme of 16
characters, a host of 255 (kept) and 256 (refused) characters, NULL.
Red before the fix: exactly sftp://-l@host/ and sftp://-p22@host/ accepted;
green after: make check 5 of 5 (34 ok lines in test_netmount).

Not done of t0081: the checks of mcde_sys_wifi_join (netbsd.c:534ff, SSID 33
bytes, quotes, backslash, passphrase 8..63) -- they come after geteuid() != 0
and are NetBSD-only (the Linux branch checks the length only and must keep
quotes in a passphrase), so no test of the build can reach them without a
shared validator; catalogs and @PREFIX@ untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 00:58:27 +00:00
lotherkandClaude Sonnet 5.5 cc770d000e dtfile: a mount no longer freezes the window; Connecting dialog, Cancel, Dtfile*connectTimeout (t0080 item 4)
mcde_sys_net_mount ran in the Xt callback and waited for sshfs/mount_afp
without a limit: a server that is gone froze the window for as long as the
tool lived (measured: the call returns after 20.0 s with a tool that sleeps
20 s; with one that never ends, never).

McdeSys: mcde_sys_net_mount_start/_job_fd/_job_finish/_job_cancel.  The tool
runs under a runner process (its own process group) that writes the answer
to a pipe: dtfile sets SIGCHLD to SIG_IGN (Main.c), where waitpid gives no
status.  mcde_sys_net_mount and _start share one plan (MountPlanFor).
test_job (make check, 5 of 5 pass) covers success, failure, a missing tool,
a password on stdin, and cancel with the tool AND what it started gone, with
SIGCHLD default and ignored; without the group kill it fails (mutant run).

dtfile: _McdeNetMount (NetView.c) for all three mounts (network view,
Connect to Server, column view): a modal "Connecting ..." dialog with Cancel
(also close button and Escape), the descriptor as Xt input (no timer
polling), one time-out, Dtfile*connectTimeout, 20 s, 3..600 (app-defaults,
man page).

Measured (real dtfile on Xvfb, fake sshfs that sleeps 40 s, connectTimeout
4): the dialog shows and repaints when moved; the time-out gives "Could not
connect: The server did not answer within 4 seconds.", Escape gives
"Could not connect: Cancelled."; sleep processes while connecting 1, after
the time-out 0, after Escape 0; no dialog left.  One first run showed a 40 s
stall of the whole session after Return (import blocked too); not
reproduced in three further runs, cause unknown.  Cross compile for NetBSD
(x86_64--netbsd-gcc, the build's flags): netmount.c and NetView.c without a
warning; common.c's old settimeofday declaration warning is not new.  Not
done: the NFS and AFP tools (only sshfs was faked), the afp://10.255.255.1/
case of the task with a real mount_afp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 00:28:27 +00:00
lotherkandClaude Sonnet 5.5 14a25a4ac2 McdeSys: the bar's status reads end after 2 s (t0080)
A hung pactl made mcde_sys_volume_get wait 40 s (pactl info, then
get-sink-volume, then get-sink-mute; measured with a fake pactl that
sleeps 20 s in a private mount namespace).  The reads the bar repeats to
show a state -- volume (pactl, mixerctl, amixer), Bluetooth (bluetoothctl,
btconfig), the Wi-Fi network (iw) -- now use mcde_sys_capture_limited with
MCDE_SYS_STATUS_SECONDS (2 s, private.h).  Pactl() keeps its answer: a
"yes" until a read fails, a "no" for 30 s, so a stopped server costs
one 2 s wait, then the mixer answers.

Measured after: pactl hangs: 2.0 s, then 0.0 s (mixer); amixer hangs:
2.0 s a call, rc=-6; bluetoothctl hangs: 2.0 s, present=1 on=0; no
shim: 0.0 s.  make mcde-linux check: 4 of 4 tests pass.  Wi-Fi scan and
join, network configuration, disks and updates keep the unlimited call:
they do real work.  AGENTS.md says so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 00:06:43 +00:00