Skip to content

Commit ccffc98

Browse files
committed
kvs-watch: allow guests to access module stats
Problem: flux module stats is generally open to guests, but the RPC override in the kvs-watch module is not. Open kvs-watch.stats-get to guests. Add a test to t1005-kvs-security.t.
1 parent 3706fb9 commit ccffc98

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/modules/kvs-watch/kvs-watch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ static const struct flux_msg_handler_spec htab[] = {
10751075
{ .typemask = FLUX_MSGTYPE_REQUEST,
10761076
.topic_glob = "kvs-watch.stats-get",
10771077
.cb = stats_cb,
1078-
.rolemask = 0
1078+
.rolemask = FLUX_ROLE_USER
10791079
},
10801080
{ .typemask = FLUX_MSGTYPE_REQUEST,
10811081
.topic_glob = "kvs-watch.lookup",

t/t1005-kvs-security.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ test_expect_success 'kvs: stats works (user)' '
298298
unset_userid
299299
'
300300

301+
test_expect_success 'kvs-watch: stats works (user)' '
302+
set_userid 9999 &&
303+
flux module stats kvs-watch >/dev/null &&
304+
unset_userid
305+
'
306+
301307
test_expect_success 'kvs: stats clear fails (user)' '
302308
set_userid 9999 &&
303309
! flux module stats -c kvs &&

0 commit comments

Comments
 (0)