From: Sage Weil Date: Wed, 13 Mar 2013 20:40:47 +0000 (-0700) Subject: auth: assert if auth_debug = true and secret_id == 0 X-Git-Tag: v0.60~84 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7710ee23d79e2d4747face970a6ce0bf46e81ba9;p=ceph.git auth: assert if auth_debug = true and secret_id == 0 Hunting #4282. Signed-off-by: Sage Weil --- diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 483415fac029..8e55bcdd762e 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -423,6 +423,8 @@ bool cephx_verify_authorizer(CephContext *cct, KeyStore *keys, if (!keys->get_service_secret(service_id, ticket.secret_id, service_secret)) { ldout(cct, 0) << "verify_authorizer could not get service secret for service " << ceph_entity_type_name(service_id) << " secret_id=" << ticket.secret_id << dendl; + if (cct->_conf->auth_debug && ticket.secret_id == 0) + assert(0 == "got secret_id=0"); return false; } } diff --git a/src/common/config_opts.h b/src/common/config_opts.h index f102dfab218c..09facc4c2d94 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -192,6 +192,7 @@ OPTION(cephx_service_require_signatures, OPT_BOOL, false) OPTION(cephx_sign_messages, OPT_BOOL, true) // Default to signing session messages if supported OPTION(auth_mon_ticket_ttl, OPT_DOUBLE, 60*60*12) OPTION(auth_service_ticket_ttl, OPT_DOUBLE, 60*60) +OPTION(auth_debug, OPT_BOOL, false) // if true, assert when weird things happen OPTION(mon_client_hunt_interval, OPT_DOUBLE, 3.0) // try new mon every N seconds until we connect OPTION(mon_client_ping_interval, OPT_DOUBLE, 10.0) // ping every N seconds OPTION(mon_client_max_log_entries_per_message, OPT_INT, 1000)