Bug #49301
mon/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:
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
History
#1 Updated by Ramana Raja 3 days 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 about 6 hours ago
- Pull request ID set to 39680