From: Yonatan Zaken Date: Mon, 22 Jun 2026 17:02:39 +0000 (+0300) Subject: ceph.in: reject -w/--watch flags when used with subcommands X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F69652%2Fhead;p=ceph.git ceph.in: reject -w/--watch flags when used with subcommands parse_known_args() silently consumes -w and all --watch-* flags before subcommand arguments reach the command validator. When a user ran "ceph orch ps -w", the watch handler entered cluster log streaming mode while discarding the subcommand entirely, with no error or indication that the orch ps command was ignored. Add a guard at the entry of the watch handler: if any watch flag is active and childargs is non-empty, print "Invalid command: unused arguments: [...]" and return EINVAL. This matches the behaviour already seen when -s/--status is combined with a subcommand. Assisted-by: Claude:claude-4.6-sonnet Fixes: https://tracker.ceph.com/issues/77121 Signed-off-by: Yonatan Zaken --- diff --git a/src/ceph.in b/src/ceph.in index 4694da29db5..3379de7488e 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -1131,6 +1131,9 @@ def main(): elif k != "watch_channel": level = k.replace('watch_', '') if level: + if childargs: + print('Invalid command: unused arguments: {0}'.format(childargs), file=sys.stderr) + return errno.EINVAL # an awfully simple callback def watch_cb(arg, line, channel, name, who, stamp_sec, stamp_nsec, seq, level, msg): # Filter on channel