jamulusserver/setDirectory silently substitutes any_genre_1 for an unrecognised directoryType and replies ok
メンテナーはふだん 6 日以内に返信
評価
調査の方向性
エントリポイント jamulusserver/setDirectory から開始し、DeserializeDirectoryType() と sumStringToDirectoryType を調べてください。検証動作を jamulusclient/setSkillLevel と比較してください。報告されている24ケースのサーバー RPC 比較をテストの基準として使用し、無効な値がディレクトリ設定を変更せずにエラーを返すようになった時点で、main と release/3_12 のどちらにするかというメンテナーの判断が完了したものとみなしてください。
索引モデルが issue の本文から書いたものです。
説明
🤖 AI: jamulusserver/setDirectory accepts any string as directoryType and replies "ok". Unrecognised values are silently mapped to any_genre_1, the public default.
DeserializeDirectoryType() returns AT_DEFAULT when the lookup misses, and sumStringToDirectoryType is an unordered_map keyed on std::string, so matching is byte-exact: case-sensitive and not trimmed.
Measured on loopback with *.jamulus.app redirected to 127.0.0.1 in /etc/hosts, so no probe reached a real directory. Each row: set, then read back with getServerProfile, one request per fresh connection.
directoryType sent |
reply | resulting type | registered with |
|---|---|---|---|
custom + address |
ok | custom |
my.private.example:22124 |
CUSTOM + address |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
custon + address |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
custom (trailing space) |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
custom, no address |
-32602 | unchanged | — |
CUSTOM, no address |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
GENRE_ROCK |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
genre_rockk |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
genre-rock |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
NONE |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
unknown_xyz |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
"" |
ok | any_genre_1 |
anygenre1.jamulus.app:22124 |
Two consequences.
A typo moves a running server off its chosen genre. Set genre_jazz, then send GENRE_JAZZ. The reply is "ok" and the server is now registered with any_genre_1.
The custom guard cannot fire for the inputs it exists to catch. setDirectory already rejects custom supplied without a directoryAddress, but that check tests the deserialized enum rather than the input string — so "CUSTOM" becomes AT_DEFAULT before the check runs. An operator asking for their own directory is registered with the public one, their directoryAddress stored and ignored, and the reply is "ok".
The matrix above was measured against main @ 97799184. I re-checked today: DeserializeDirectoryType() is byte-identical in main and in r3_12_4, so this is present unchanged in release/3_12.
I hit this in practice rather than only in testing — unregistering a server via {"directoryType":"none"} is one keystroke away from publishing it to the busiest directory on the network, with a success reply either way.
I have a patch that returns -32602 for an unrecognised value, echoing it and listing the accepted set, and leaves the directory setting unchanged. It follows jamulusclient/setSkillLevel, which already rejects unrecognised enum strings this way. A/B against baseline across 24 cases of the server RPC surface: 22 identical, 2 intended differences, 0 unintended.
Before opening anything, one decision that is yours rather than mine.
Rejecting is a behaviour change on an API released in 3.12.0. A script sending a bad value today gets "ok"; afterwards it gets an error. My reading is that this is the point, since the current reply reports a success that did not happen — but it is a break, so:
- reject on
mainonly and leaverelease/3_12as is, - reject on both,
- or an alternative you prefer, such as keeping the fallback and reporting the substitution in the result.
Happy to open a PR once you've said which.
🤖 This message was written by AI and reviewed by @mcfnord.
- 主要言語
- C
- スター
- 1.1k
- フォーク
- 248
- 平均マージ
- 11日 40分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jamulussoftware/jamulus のほかの issue
-
Move translation checker (and potentially other runners) to ARM runner対応中かも @ann0see が 28 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jamulussoftware/jamulus#3953 · コメント 2 件 ·
メンテナーはふだん 6 日以内に返信
-
AI
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jamulussoftware/jamulus#3846 ·
メンテナーはふだん 6 日以内に返信
-
feature request
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
jamulussoftware/jamulus#3964 · コメント 3 件 ·
メンテナーはふだん 6 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
jamulussoftware/jamulus#3961 ·
メンテナーはふだん 6 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
jamulussoftware/jamulus#3958 ·
メンテナーはふだん 6 日以内に返信
jamulussoftware/jamulus の issue をすべて見る
似ている issue
-
docs: AGENTS.md has no rule against running deploy scripts into the owner's game install対応中かも @thesprockee が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
EchoTools/nevr-runtime#524 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
type: feature
難易度 1/5 1時間未満 初心者へのやさしさ 77/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FujiNetWIFI/fujinet-firmware#1932 ·
メンテナーはふだん 1 日以内に返信