New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
authtool: Enhance argument combinations validation #9704
Conversation
make[5]: *** Deleting file `test/cephtool-test-mds.sh.log' Known issue. |
@@ -86,6 +86,10 @@ int main(int argc, const char **argv) | |||
} else if (ceph_argparse_flag(args, i, "--gen-print-key", (char*)NULL)) { | |||
gen_print_key = true; | |||
} else if (ceph_argparse_witharg(args, i, &val, "-a", "--add-key", (char*)NULL)) { | |||
if (val.empty()) { | |||
cerr << "Option --add-key requires an argument" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "an non-empty argument".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this matches an existing error message from ceph_argparse for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it!
|
||
Test --add-key with empty argument | ||
|
||
$ /home/brad/working/src/ceph/src/ceph-authtool kring -C --name=mon.* --add-key= --cap mon 'allow *' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to use a path also applies under other circumstances.
OOPs! Sure, let me fix that... |
f567e17
to
fa246a8
Compare
Under certain circumstances ceph-authtool can create invalid key entries in the specified keyring and behave less than intuitively. What's worse these keys can currently cause ceph daemons to crash. This patch attempts to tighten the behaviour and eliminate the possibility an invalid key can be created. Fixes: http://tracker.ceph.com/issues/2904 Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
fa246a8
to
d15ad96
Compare
lgtm, and tested locally, will merge once jenkins finishes. |
Under certain circumstances ceph-authtool can create invalid key entries in
the specified keyring and behave less than intuitively. What's worse these
keys can currently cause ceph daemons to crash. This patch attempts to tighten
the behaviour and eliminate the possibility an invalid key can be created.
http://tracker.ceph.com/issues/2904
Fixes: #2904
Signed-off-by: Brad Hubbard bhubbard@redhat.com