Merge "printer: print FileIdentifier" into tizen_5.5
[platform/core/system/libdbuspolicy.git] / src / internal / storage_backend_serialized.cpp
index 5271adf..fa8fe4e 100644 (file)
@@ -280,12 +280,20 @@ bool StorageBackendSerialized::StorageBackendSerializedImpl::init(const char *fi
                return err("mmap");
 
        auto mmapGuard = transaction_guard::makeGuard([&] () { releaseMMap(); });
-
        if (verify) {
                auto verifier = flatbuffers::Verifier(mem, length);
                if (!FB::VerifyFileBuffer(verifier) || !FB::FileBufferHasIdentifier(mem)) {
-                       tslog::log_error("verification of serialized data: failed\n");
-                       return false;
+                       char fid[FB::FB_ID_SIZE + 1] = {0, };
+                       strncpy(fid, (const char *)(mem + FB::FB_ID_OFFSET), FB::FB_ID_SIZE);
+
+                       if (strcmp(fid, "LDP1") == 0) {
+                               tslog::log_error("verification of serialized data: not available\n");
+                               tslog::log_error("header ID          : ", FB::FileIdentifier(), "\n");
+                               tslog::log_error("serialized data ID : ", fid, "\n");
+                       } else {
+                               tslog::log_error("verification of serialized data: failed\n");
+                               return false;
+                       }
                }
        }