Fix room server: Read-Only ACL role can still post messages - #3340
Open
smellyspice wants to merge 1 commit into
Open
Fix room server: Read-Only ACL role can still post messages#3340smellyspice wants to merge 1 commit into
smellyspice wants to merge 1 commit into
Conversation
The room server's TXT_TYPE_PLAIN post-acceptance check only excludes clients with the Guest role (assigned via a blank/read-only login). A client explicitly given the Read-Only role via 'setperm' is not Guest, so it falls through to the posting branch and gets accepted and stored like a Read-Write client's post. Exclude both Guest and Read-Only from the posting gate, so only Read-Write and Admin roles can post.
smellyspice
added a commit
to smellyspice/MeshCore
that referenced
this pull request
Sep 2, 2026
- storePost() now mirrors the posts[] cyclic queue to flash (/posts) on every write; begin() restores it before the board starts serving, so a reboot no longer wipes the archive clients sync against. - Fix: a contact explicitly assigned the Read-Only ACL role (via setperm) could still post -- the posting gate only excluded Guest. Now excludes both. Same fix as upstream PR meshcore-dev#3340.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The room server's ACL has four roles: Guest, Read-Only, Read-Write, and Admin. A contact can be given the Read-Only role directly via the
setpermCLI command (or the app's ACL/permissions editor, which uses it). However, that role doesn't actually prevent posting.Root cause
The check that decides whether an incoming plain-text message gets accepted as a post only excludes the Guest role:
A client explicitly set to
PERM_ACL_READ_ONLYis notPERM_ACL_GUEST, so it falls into theelsebranch and gets to post exactly like a Read-Write client would.Fix
Exclude both
PERM_ACL_GUESTandPERM_ACL_READ_ONLYfrom the posting gate, so onlyPERM_ACL_READ_WRITEandPERM_ACL_ADMINcan post.Testing
pio run -e heltec_v4_r8_room_server: builds successfullypio test -e native) currently fail to build on this branch's base for an unrelated, pre-existing reason (missing<cstdlib>include inConfigSerializer.cpp, causingatoi/atof/atolto be undeclared) — not something this change touches.Compatibility
setpermcan no longer post.