Actions
Bug #49301
closedmon/MonCap: `fs authorize` generates unparseable cap for file system name containing '-'
% 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
Updated by Ramana Raja about 3 years 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'));
Updated by Patrick Donnelly about 3 years ago
- Status changed from In Progress to Pending Backport
Updated by Backport Bot about 3 years ago
- Copied to Backport #49564: pacific: mon/MonCap: `fs authorize` generates unparseable cap for file system name containing '-' added
Updated by Nathan Cutler about 3 years 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".
Actions