From: Lukasz Pawelczyk Date: Tue, 21 Nov 2017 12:08:01 +0000 (+0100) Subject: Fix cppcheck/svace warnings X-Git-Tag: submit/tizen/20171201.152910~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57697ab99b2a5edf61e21a2bac25932bc1d58d7e;p=platform%2Fcore%2Fsecurity%2Fode.git Fix cppcheck/svace warnings Change-Id: I29b64165784c8162e8ae0fdc50d201856d6540fb --- diff --git a/rmi/external-encryption.h b/rmi/external-encryption.h index 39ffa50..e2a577a 100644 --- a/rmi/external-encryption.h +++ b/rmi/external-encryption.h @@ -28,6 +28,8 @@ namespace ode { class ExternalEncryption { public: + virtual ~ExternalEncryption() {}; + virtual int setMountPassword(const std::string& password) = 0; virtual int mount() = 0; diff --git a/rmi/internal-encryption.h b/rmi/internal-encryption.h index 437e86b..eb9f5ea 100644 --- a/rmi/internal-encryption.h +++ b/rmi/internal-encryption.h @@ -27,6 +27,8 @@ namespace ode { class InternalEncryption { public: + virtual ~InternalEncryption() {}; + virtual int setMountPassword(const std::string& password) = 0; virtual int mount() = 0; diff --git a/rmi/luks.h b/rmi/luks.h index 73ea15f..869d312 100644 --- a/rmi/luks.h +++ b/rmi/luks.h @@ -27,6 +27,8 @@ namespace ode { class Luks { public: + virtual ~Luks() {}; + virtual int format(bool sync, const std::string& device, const std::string& password) = 0; diff --git a/rmi/secure-erase.h b/rmi/secure-erase.h index d9af2b4..af9964e 100644 --- a/rmi/secure-erase.h +++ b/rmi/secure-erase.h @@ -17,6 +17,8 @@ #ifndef __SECURE_ERASE_H__ #define __SECURE_ERASE_H__ +#include + namespace ode { /** @@ -25,6 +27,8 @@ namespace ode { class SecureErase { public: + virtual ~SecureErase() {}; + virtual int clean(const std::string& name) = 0; }; diff --git a/server/file-footer.cpp b/server/file-footer.cpp index a8a12d6..008c55c 100644 --- a/server/file-footer.cpp +++ b/server/file-footer.cpp @@ -79,7 +79,7 @@ void FileFooter::write(const std::string &key, const data &value) runtime::File file(fileName); - file.create(0600); + file.create(S_IRUSR | S_IWUSR); file.write(value.data(), value.size()); }