Bug 2218189 - print better error message for wrong permissions in MDS caps
Summary: print better error message for wrong permissions in MDS caps
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: CephFS
Version: 5.3
Hardware: All
OS: All
unspecified
low
Target Milestone: ---
: 6.1z4
Assignee: Rishabh Dave
QA Contact: julpark
Disha Walvekar
URL:
Whiteboard:
Depends On:
Blocks: 2261930
TreeView+ depends on / blocked
 
Reported: 2023-06-28 11:50 UTC by Rishabh Dave
Modified: 2024-02-08 18:13 UTC (History)
8 users (show)

Fixed In Version: ceph-17.2.6-189.el9cp
Doc Type: Enhancement
Doc Text:
Unlike MON caps, permissions in MDS capability either should start with "r" or "rw" or should be "*" or "all". Unlike before, with this fix, "ceph auth" will print a clear message when the permissions in the MDS caps are incorrect. "ceph auth" subcommands being referred here are "ceph auth add", "ceph auth caps", "ceph auth get-or-create" and "ceph auth get-or-create-key".
Clone Of:
Environment:
Last Closed: 2024-02-08 18:13:33 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 61666 0 None None None 2023-06-28 11:56:25 UTC
Github ceph ceph pull 52042 0 None open MDSAuthCaps: print better error message for perm flag in MDS caps 2023-06-28 11:57:03 UTC
Red Hat Issue Tracker RHCEPH-6933 0 None None None 2023-06-28 11:52:18 UTC
Red Hat Product Errata RHBA-2024:0747 0 None None None 2024-02-08 18:13:38 UTC

Description Rishabh Dave 2023-06-28 11:50:56 UTC
Description of problem:

Any permissions in MDS caps besides "allow *" and "allow w" must start with "allow r" or "allow rw". Otherwise the MDS cap is rejected. The error printed by MDS in this case is the generic error the MDS prints in every case of incorrect MDS caps.

Unlike some other Ceph daemons, MDS doesn't permission like "allow w". Therefore, print a special error message so that users are specifically told that the permissions in the MDS caps, besides "all" and "*", must start with "r" or "rw".

Such a message is printed in case of "ceph fs authorize" but the commands "ceph auth add", "ceph auth caps", "ceph auth get-or-create" and "ceph auth get-or-create-key" don't. Let's make these commands too print a special message.

Version-Release number of selected component (if applicable):


How reproducible:
Everytime

Comment 7 julpark 2024-01-17 14:39:12 UTC
[root@ceph-julpark-kd407z-node7 cephuser]# eph auth get-or-create client.name1 mon "allow *" mds "allow w" mgr "allow rw" osd "allow rw tag cephfs data=cephfs" -o /etc/ceph/ceph.client.name1.keyring
bash: eph: command not found
[root@ceph-julpark-kd407z-node7 cephuser]# ceph auth get-or-create client.name1 mon "allow *" mds "allow w" mgr "allow rw" osd "allow rw tag cephfs data=cephfs" -o /etc/ceph/ceph.client.name1.keyring
Error EINVAL: Permission flags in MDS caps must start with 'r' or 'rw' or be '*' or 'all'
[root@ceph-julpark-kd407z-node7 cephuser]#

verified on 17.2.6-193.el9cp

Comment 11 errata-xmlrpc 2024-02-08 18:13:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 6.1 Bug Fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2024:0747


Note You need to log in before you can comment on or make changes to this bug.