]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mount.ceph: remove arbitrary limit on size of name= option 32706/head
authorJeff Layton <jlayton@redhat.com>
Fri, 17 Jan 2020 12:48:12 +0000 (07:48 -0500)
committerJeff Layton <jlayton@redhat.com>
Mon, 20 Jan 2020 22:14:43 +0000 (17:14 -0500)
commit8db2a44c9438749be98d41fb309f10d5084805df
tree5f35ebe8488f1a6d907c2d8d8775f0eafc37ee09
parentaf0e482a3fe8ec66b4681b9604ca7bcb28faf934
mount.ceph: remove arbitrary limit on size of name= option

Aaron was getting back -ERANGE errors when trying to mount using
a long name= option. The issue is that the destination buffer for the
"key=" string is not big enough to hold long names.

When I overhauled the mount.ceph code recently, I made this buffer much
smaller than before figuring that it didn't need to be any larger than
the length of "secret=<base64 encoded key>".

In the case where the secret is set in the keyring though, this buffer
needs to be able to hold a string like "key=client.<cephx name>". The
cephx name can be of arbitrary length, however.

Rework the code to just safe_cat the strings directly into the options
buffer, eliminating an extra copy and the need for an arbitrary limit.
This also allows us to remove get_secret_option() from the the common
code as well.

Fixes: https://tracker.ceph.com/issues/43649
Reported-by: Aaron <aarongmldt@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/common/secret.c
src/common/secret.h
src/mount/mount.ceph.c
src/mount/mount.ceph.h