Fix cppcheck/svace warnings 04/161104/1
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Tue, 21 Nov 2017 12:08:01 +0000 (13:08 +0100)
committerLukasz Pawelczyk <l.pawelczyk@samsung.com>
Tue, 21 Nov 2017 12:08:01 +0000 (13:08 +0100)
Change-Id: I29b64165784c8162e8ae0fdc50d201856d6540fb

rmi/external-encryption.h
rmi/internal-encryption.h
rmi/luks.h
rmi/secure-erase.h
server/file-footer.cpp

index 39ffa50..e2a577a 100644 (file)
@@ -28,6 +28,8 @@ namespace ode {
 
 class ExternalEncryption {
 public:
+       virtual ~ExternalEncryption() {};
+
        virtual int setMountPassword(const std::string& password) = 0;
 
        virtual int mount() = 0;
index 437e86b..eb9f5ea 100644 (file)
@@ -27,6 +27,8 @@ namespace ode {
 
 class InternalEncryption {
 public:
+       virtual ~InternalEncryption() {};
+
        virtual int setMountPassword(const std::string& password) = 0;
 
        virtual int mount() = 0;
index 73ea15f..869d312 100644 (file)
@@ -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;
index d9af2b4..af9964e 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __SECURE_ERASE_H__
 #define __SECURE_ERASE_H__
 
+#include <string>
+
 namespace ode {
 
 /**
@@ -25,6 +27,8 @@ namespace ode {
 
 class SecureErase {
 public:
+       virtual ~SecureErase() {};
+
        virtual int clean(const std::string& name) = 0;
 };
 
index a8a12d6..008c55c 100644 (file)
@@ -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());
 }