Skip to content

Commit e5ee200

Browse files
committed
broker: prevent remote groups.join/leave
Problem: groups.join and groups.leave RPCs do not behave as designed when used remotely, but this is allowed by the RPC handlers. Respond with an error if the join/leave request is not of local origin.
1 parent 40d6f4c commit e5ee200

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/broker/groups.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,11 @@ static void join_request_cb (flux_t *h,
441441

442442
if (flux_request_unpack (msg, NULL, "{s:s}", "name", &name) < 0)
443443
goto error;
444+
if (!flux_msg_is_local (msg)) {
445+
errno = EPROTO;
446+
errmsg = "groups.join is restricted to the local broker";
447+
goto error;
448+
}
444449
if (!(group = group_lookup (g, name, true)))
445450
goto error;
446451
if (group->join_request) {
@@ -485,6 +490,11 @@ static void leave_request_cb (flux_t *h,
485490

486491
if (flux_request_unpack (msg, NULL, "{s:s}", "name", &name) < 0)
487492
goto error;
493+
if (!flux_msg_is_local (msg)) {
494+
errno = EPROTO;
495+
errmsg = "groups.leave is restricted to the local broker";
496+
goto error;
497+
}
488498
if (!(group = group_lookup (g, name, false))
489499
|| !group->join_request) {
490500
snprintf (errbuf,

0 commit comments

Comments
 (0)