]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mount.ceph: remove arbitrary limit on size of name= option 32807/head
authorJeff Layton <jlayton@redhat.com>
Fri, 17 Jan 2020 12:48:12 +0000 (07:48 -0500)
committerNathan Cutler <ncutler@suse.com>
Thu, 23 Jan 2020 16:45:58 +0000 (17:45 +0100)
commit80f6f924a3b391f33004fa5fb734746fd1ce0351
tree646f182fafdda1a852948d30d8ff7e765a53e633
parent2a9c6636e5761c5537b6ccec8dd0675144cbbd41
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>
(cherry picked from commit 8db2a44c9438749be98d41fb309f10d5084805df)

Conflicts:
src/common/secret.c
src/common/secret.c
src/common/secret.h
src/mount/mount.ceph.c
src/mount/mount.ceph.h