From 82d15833d512440fcac0557a408df05cc732236c Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 23 Aug 2018 11:18:15 -0400 Subject: [PATCH] auth: Use ceph_assert for asserts Signed-off-by: Adam C. Emerson --- src/auth/Crypto.h | 8 ++++---- src/auth/cephx/CephxKeyServer.cc | 2 +- src/auth/cephx/CephxKeyServer.h | 2 +- src/auth/cephx/CephxProtocol.cc | 2 +- src/auth/cephx/CephxProtocol.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/auth/Crypto.h b/src/auth/Crypto.h index cc999b0a1a4cb..4cda0830343fb 100644 --- a/src/auth/Crypto.h +++ b/src/auth/Crypto.h @@ -146,12 +146,12 @@ public: int create(CephContext *cct, int type); int encrypt(CephContext *cct, const bufferlist& in, bufferlist& out, std::string *error) const { - assert(ckh); // Bad key? + ceph_assert(ckh); // Bad key? return ckh->encrypt(in, out, error); } int decrypt(CephContext *cct, const bufferlist& in, bufferlist& out, std::string *error) const { - assert(ckh); // Bad key? + ceph_assert(ckh); // Bad key? return ckh->decrypt(in, out, error); } @@ -160,12 +160,12 @@ public: std::size_t encrypt(CephContext*, const in_slice_t& in, const out_slice_t& out) { - assert(ckh); + ceph_assert(ckh); return ckh->encrypt(in, out); } std::size_t decrypt(CephContext*, const in_slice_t& in, const out_slice_t& out) { - assert(ckh); + ceph_assert(ckh); return ckh->encrypt(in, out); } diff --git a/src/auth/cephx/CephxKeyServer.cc b/src/auth/cephx/CephxKeyServer.cc index 38483253d0cd9..8d294ddbcd349 100644 --- a/src/auth/cephx/CephxKeyServer.cc +++ b/src/auth/cephx/CephxKeyServer.cc @@ -351,7 +351,7 @@ int KeyServer::encode_secrets(Formatter *f, stringstream *ds) const void KeyServer::encode_formatted(string label, Formatter *f, bufferlist &bl) { - assert(f != NULL); + ceph_assert(f != NULL); f->open_object_section(label.c_str()); encode_secrets(f, NULL); f->close_section(); diff --git a/src/auth/cephx/CephxKeyServer.h b/src/auth/cephx/CephxKeyServer.h index 2b069c4d32e08..80a3aa927226b 100644 --- a/src/auth/cephx/CephxKeyServer.h +++ b/src/auth/cephx/CephxKeyServer.h @@ -151,7 +151,7 @@ struct KeyServerData { __u32 _op; decode(_op, bl); op = (IncrementalOp)_op; - assert(op >= AUTH_INC_NOP && op <= AUTH_INC_SET_ROTATING); + ceph_assert(op >= AUTH_INC_NOP && op <= AUTH_INC_SET_ROTATING); if (op == AUTH_INC_SET_ROTATING) { decode(rotating_bl, bl); } else { diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 59254680635e1..d815a98c3835f 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -429,7 +429,7 @@ bool cephx_verify_authorizer(CephContext *cct, KeyStore *keys, 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"); + ceph_assert(0 == "got secret_id=0"); return false; } } diff --git a/src/auth/cephx/CephxProtocol.h b/src/auth/cephx/CephxProtocol.h index 16135ec11f31a..4629bba80add4 100644 --- a/src/auth/cephx/CephxProtocol.h +++ b/src/auth/cephx/CephxProtocol.h @@ -347,7 +347,7 @@ struct CephXTicketManager { CephXTicketHandler newTicketHandler(cct, type); std::pair < tickets_map_t::iterator, bool > res = tickets_map.insert(std::make_pair(type, newTicketHandler)); - assert(res.second); + ceph_assert(res.second); return res.first->second; } CephXAuthorizer *build_authorizer(uint32_t service_id) const; -- 2.39.5