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 39ffa5038d4be26be37cbf1c27d1cdd227a6c22c..e2a577a52f91a5ded97d29bb57d3e33cb11df321 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 437e86b902814b43b9aadd1405d8a39d840706b6..eb9f5ea699285a77301652d1e899b80da6692d13 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 73ea15f35ac0750cce0b9d3b5d3a8f58ea57d4e0..869d3128be75851f3ae1e46e221e713fd4c6833f 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 d9af2b429382dea43bc8f0db313362f039555b25..af9964e62fc95e3d5c242d25cc337288ad225093 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 a8a12d66471693bee59acca41d838be470889b86..008c55c2dc41342544eea8fbe82cc13a80151c46 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());
 }