From: Lucian Petrut Date: Wed, 20 Jan 2021 11:42:03 +0000 (+0000) Subject: rbd: use ceph_memzero_s instead of explicit_bzero X-Git-Tag: v17.1.0~3165^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b94acad0c41d20cdae48e01fbbc1ae26229c75b;p=ceph.git rbd: use ceph_memzero_s instead of explicit_bzero explicit_bzero isn't available on Windows. We'll use the portable ceph_memzero_s function instead. Signed-off-by: Lucian Petrut --- diff --git a/src/tools/rbd/action/Encryption.cc b/src/tools/rbd/action/Encryption.cc index 7796eee267d..a997fe7017e 100644 --- a/src/tools/rbd/action/Encryption.cc +++ b/src/tools/rbd/action/Encryption.cc @@ -1,6 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include "include/compat.h" #include "include/scope_guard.h" #include "tools/rbd/ArgumentTypes.h" #include "tools/rbd/Shell.h" @@ -66,7 +67,7 @@ int execute(const po::variables_map &vm, std::string passphrase((std::istreambuf_iterator(file)), (std::istreambuf_iterator())); auto sg = make_scope_guard([&] { - explicit_bzero(&passphrase[0], passphrase.size()); }); + ceph_memzero_s(&passphrase[0], passphrase.size(), passphrase.size()); }); file.close(); if (!passphrase.empty() && passphrase[passphrase.length() - 1] == '\n') { passphrase.erase(passphrase.length() - 1);