Specify a keyring for use with ``--mkfs``.
+.. option:: --use-mon-keyring
+
+ Use the mon's keyring file as authoritative for the "mon." secret. Normally
+ the key in the mons' auth database is used.
+
.. option:: --no-config-file
Signal that we don't want to rely on a *ceph.conf*, either user provided
<< " write the <filename> monmap to the local monitor store and exit\n"
<< " --extract-monmap <filename>\n"
<< " extract the monmap from the local monitor store and exit\n"
+ << " --use-mon-keyring\n"
+ << " use the mon keyring as authoritative for the mon. secret\n"
<< " --mon-data <directory>\n"
<< " where the mon store and keyring are located\n"
<< " --set-crush-location <bucket>=<foo>"
bool compact = false;
bool force_sync = false;
bool yes_really = false;
+ bool use_mon_keyring = false;
std::string osdmapfn, inject_monmap, extract_monmap, crush_loc;
auto args = argv_to_vec(argc, argv);
force_sync = true;
} else if (ceph_argparse_flag(args, i, "--yes-i-really-mean-it", (char*)NULL)) {
yes_really = true;
+ } else if (ceph_argparse_flag(args, i, "--use-mon-keyring", (char*)NULL)) {
+ use_mon_keyring = true;
} else if (ceph_argparse_witharg(args, i, &val, "--osdmap", (char*)NULL)) {
osdmapfn = val;
} else if (ceph_argparse_witharg(args, i, &val, "--inject_monmap", (char*)NULL)) {
*_dout << dendl;
}
+ if (use_mon_keyring) {
+ mon->use_keyring_as_authoritative();
+ }
+
err = mon->preinit();
if (err < 0) {
derr << "failed to initialize" << dendl;
dout(20) << __func__ << ": verify authorizer was_challenge=" << was_challenge << dendl;
bool isvalid = ah->verify_authorizer(
cct,
- key_server,
+ use_mon_keyring ? static_cast<KeyStore&>(keyring) : static_cast<KeyStore&>(key_server),
payload,
auth_meta->get_connection_secret_length(),
reply,
return std::chrono::duration_cast<std::chrono::milliseconds>(now-starttime);
}
+private:
+ bool use_mon_keyring = false;
+public:
+ void use_keyring_as_authoritative() {
+ use_mon_keyring = true;
+ }
+
private:
ceph::coarse_mono_time const starttime = coarse_mono_clock::now();
epoch_t probe_epoch = 0;