Cliloc lookup is case-sensitive on Linux — bridge import fails on a Mono shard shipping Cliloc.enu #37

Closed
opened 2026-11-25 16:17:30 -06:00 by wtclaude · 0 comments
Member

Summary

On a Linux shard running under Mono, the cliloc import over the bridge fails with:

this shard's client has no cliloc.enu (looked where ServUO's own data path points)

even though the client's cliloc file is present and readable by the shard. The cause
is a case-sensitive file lookup: the client ships Cliloc.enu (capital C), but
BridgeCliloc resolves it as the all-lowercase cliloc.enu. On Windows (NTFS,
case-insensitive) that matched; on a case-sensitive filesystem (ext4) it does not.

Root cause

BridgeCliloc.ResolvePath resolves the file through Ultima.Files.GetFilePath with a
fixed lowercase name:

  • overlay/Scripts/Custom/Bridge/BridgeCliloc.cs:237-251 — ResolvePath(lang) returns
    Files.GetFilePath("cliloc." + lang) (i.e. cliloc.enu).
  • On Linux Ultima.Files probes for exactly cliloc.enu; the real file is Cliloc.enu,
    so GetFilePath returns null.
  • BridgeCliloc.cs:167-173 then emits the NOT_FOUND "has no cliloc.<lang>" reply.

This is the same class of bug the overlay already solved for UOP animation packages — see
the rationale comment at overlay/Scripts/Custom/Bridge/BridgeUop.cs:117-121
("the gargoyles import on my machine and not on the server") and the case-insensitive
resolver BridgeUop.FindClientFile (BridgeUop.cs:143). The cliloc path just never got
that treatment because its file is in Ultima.Files' known-file table, so on Windows
plain GetFilePath was always enough.

Evidence (live Linux/Mono shard)

/opt/servuo/uo-data:
-rw-rw-r-- 1 servuo servuo 5117321 Nov 21 23:27 Cliloc.enu     # only cliloc file; ext4
# sudo -u servuo test -r .../Cliloc.enu  ->  readable by the servuo service account
# shard runs as servuo (uid 997); it can read the file, but the lowercase lookup misses

The rest of the copied client directory is mixed-case as well (e.g. INTLOC02.ENU,
Intloc01.enu, intloc00.enu), i.e. a Windows client tree copied onto Linux with its
original casing intact — so this will bite any other Ultima.Files-resolved read too.

Proposed fix

In ResolvePath, when Files.GetFilePath("cliloc." + lang) returns null, fall back to
the existing case-insensitive BridgeUop.FindClientFile("cliloc." + lang), which already
enumerates ServUO's data directories (Files.RootDir + Core.DataDirectories) and matches
file names with StringComparison.OrdinalIgnoreCase. This mirrors the UOP / assets.sources
pattern, requires no operator action, and leaves the Windows path unchanged (the primary
GetFilePath still answers first there).

  • Message shape is unchanged, so no PROTOCOL_VERSION bump; overlay-only change.
  • Add a one-line note to docs/website/CLILOCS.md that cliloc resolution is case-insensitive
    (Linux shard hosts ship Cliloc.enu; the site usually runs on case-sensitive filesystems).

Operator workaround (until the fix ships)

On the shard host, lowercase the cliloc file (or the whole client dir) so the current
lookup matches:

cd /opt/servuo/uo-data && mv Cliloc.enu cliloc.enu   # no shard restart needed

Found during the UO shard's Windows -> Linux/Mono migration.

## Summary On a Linux shard running under Mono, the cliloc import over the bridge fails with: ``` this shard's client has no cliloc.enu (looked where ServUO's own data path points) ``` even though the client's cliloc file is present and readable by the shard. The cause is a **case-sensitive file lookup**: the client ships `Cliloc.enu` (capital C), but `BridgeCliloc` resolves it as the all-lowercase `cliloc.enu`. On Windows (NTFS, case-insensitive) that matched; on a case-sensitive filesystem (ext4) it does not. ## Root cause `BridgeCliloc.ResolvePath` resolves the file through `Ultima.Files.GetFilePath` with a fixed lowercase name: - `overlay/Scripts/Custom/Bridge/BridgeCliloc.cs:237-251` — `ResolvePath(lang)` returns `Files.GetFilePath("cliloc." + lang)` (i.e. `cliloc.enu`). - On Linux `Ultima.Files` probes for exactly `cliloc.enu`; the real file is `Cliloc.enu`, so `GetFilePath` returns `null`. - `BridgeCliloc.cs:167-173` then emits the `NOT_FOUND` "has no cliloc.`<lang>`" reply. This is the same class of bug the overlay already solved for UOP animation packages — see the rationale comment at `overlay/Scripts/Custom/Bridge/BridgeUop.cs:117-121` ("the gargoyles import on my machine and not on the server") and the case-insensitive resolver `BridgeUop.FindClientFile` (`BridgeUop.cs:143`). The cliloc path just never got that treatment because its file **is** in `Ultima.Files`' known-file table, so on Windows plain `GetFilePath` was always enough. ## Evidence (live Linux/Mono shard) ``` /opt/servuo/uo-data: -rw-rw-r-- 1 servuo servuo 5117321 Nov 21 23:27 Cliloc.enu # only cliloc file; ext4 # sudo -u servuo test -r .../Cliloc.enu -> readable by the servuo service account # shard runs as servuo (uid 997); it can read the file, but the lowercase lookup misses ``` The rest of the copied client directory is mixed-case as well (e.g. `INTLOC02.ENU`, `Intloc01.enu`, `intloc00.enu`), i.e. a Windows client tree copied onto Linux with its original casing intact — so this will bite any other `Ultima.Files`-resolved read too. ## Proposed fix In `ResolvePath`, when `Files.GetFilePath("cliloc." + lang)` returns `null`, fall back to the existing case-insensitive `BridgeUop.FindClientFile("cliloc." + lang)`, which already enumerates ServUO's data directories (`Files.RootDir` + `Core.DataDirectories`) and matches file names with `StringComparison.OrdinalIgnoreCase`. This mirrors the UOP / `assets.sources` pattern, requires **no operator action**, and leaves the Windows path unchanged (the primary `GetFilePath` still answers first there). - Message shape is unchanged, so **no `PROTOCOL_VERSION` bump**; overlay-only change. - Add a one-line note to `docs/website/CLILOCS.md` that cliloc resolution is case-insensitive (Linux shard hosts ship `Cliloc.enu`; the site usually runs on case-sensitive filesystems). ## Operator workaround (until the fix ships) On the shard host, lowercase the cliloc file (or the whole client dir) so the current lookup matches: ```bash cd /opt/servuo/uo-data && mv Cliloc.enu cliloc.enu # no shard restart needed ``` Found during the UO shard's Windows -> Linux/Mono migration.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/servuo-plugins#37
No description provided.