Project

General

Profile

Bug #49301

mon/MonCap: `fs authorize` generates unparseable cap for file system name containing '-'

Added by Patrick Donnelly 3 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDSMonitor
Labels (FS):
task(easy)
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

pdonnell@vossi04 ~/ceph/build$ bin/ceph fs volume create cephfs-ec                                                                                                            
Volume created successfully (no MDS daemons created)
pdonnell@vossi04 ~/ceph/build$ bin/ceph fs authorize cephfs-ec client.foo3 / rwp
Error EINVAL: mds capability parse failed, stopped at '-ec' of 'allow rwp fsname=cephfs-ec'

I checked the parser and I'm not sure why it fails. This will require a little digging. Clearly it works for the file system name parsing for vxattr parsing: https://github.com/ceph/ceph/pull/35063


Related issues

Copied to CephFS - Backport #49564: pacific: mon/MonCap: `fs authorize` generates unparseable cap for file system name containing '-' Resolved

History

#1 Updated by Ramana Raja 2 months ago

  • Status changed from New to In Progress

making the following changes fixed the issue,

diff --git a/src/mds/MDSAuthCaps.cc b/src/mds/MDSAuthCaps.cc
index 34d4febbc8c..dbf96ff3032 100644
--- a/src/mds/MDSAuthCaps.cc
+++ b/src/mds/MDSAuthCaps.cc
@@ -63,7 +63,7 @@ struct MDSCapParser : qi::grammar<Iterator, MDSAuthCaps()>
       lexeme[lit("'") >> *(char_ - '\'') >> '\''];
     unquoted_path %= +char_("a-zA-Z0-9_./-");
     network_str %= +char_("/.:a-fA-F0-9][");
-    fs_name_str %= +char_("a-zA-Z0-9-_.");
+    fs_name_str %= +char_("a-zA-Z0-9_.-");

     // match := [path=<path>] [uid=<uid> [gids=<gid>[,<gid>...]]
     // TODO: allow fsname, and root_squash to be specified with uid, and gidlist
diff --git a/src/mon/MonCap.cc b/src/mon/MonCap.cc
index 2dceb531138..dc5bbe8084c 100644
--- a/src/mon/MonCap.cc
+++ b/src/mon/MonCap.cc
@@ -540,7 +540,7 @@ struct MonCapParser : qi::grammar<Iterator, MonCap()>
     unquoted_word %= +char_("a-zA-Z0-9_./-");
     str %= quoted_string | unquoted_word;
     network_str %= +char_("/.:a-fA-F0-9][");
-    fs_name_str %= +char_("a-zA-Z0-9-_.");
+    fs_name_str %= +char_("a-zA-Z0-9_.-");

     spaces = +(lit(' ') | lit('\n') | lit('\t'));

#2 Updated by Ramana Raja 2 months ago

  • Pull request ID set to 39680

#3 Updated by Patrick Donnelly 2 months ago

  • Status changed from In Progress to Pending Backport

#4 Updated by Backport Bot 2 months ago

  • Copied to Backport #49564: pacific: mon/MonCap: `fs authorize` generates unparseable cap for file system name containing '-' added

#5 Updated by Nathan Cutler about 1 month ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Also available in: Atom PDF