Treat INTERNAL_DEV_NAME as prefix when traversing dir 49/148749/2
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Fri, 8 Sep 2017 16:40:26 +0000 (18:40 +0200)
committerLukasz Pawelczyk <l.pawelczyk@samsung.com>
Mon, 11 Sep 2017 12:21:20 +0000 (14:21 +0200)
Internal device name is /dev/disk/by-partlabel/USERDATA on TM2 device

Change-Id: I6cc088bb98aa3b6d7fd05756719dc1dbbfa2d56a

server/internal-encryption.cpp

index 11a6c1a..d6a284e 100644 (file)
@@ -25,6 +25,7 @@
 #include <mntent.h>
 #include <limits.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <vconf.h>
 #include <tzplatform_config.h>
@@ -79,7 +80,7 @@ std::string findDevPath()
                        for (char c : name) {
                                upper += std::toupper(c);
                        }
-                       if (upper == INTERNAL_DEV_NAME) {
+                       if (upper.compare(0, strlen(INTERNAL_DEV_NAME), INTERNAL_DEV_NAME) == 0) {
                                source = path;
                                break;
                        }