Bug #49301
closed
mon/MonCap: `fs authorize` generates unparseable cap for file system name containing '-'
Added by Patrick Donnelly about 3 years ago.
Updated about 3 years ago.
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
- 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'));
- Pull request ID set to 39680
- Status changed from In Progress to Pending Backport
- Copied to Backport #49564: pacific: mon/MonCap: `fs authorize` generates unparseable cap for file system name containing '-' added
- 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