]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
VentoyPlugson: Add Windows duplicate file path check for different upper/lower case.
authorlongpanda <admin@ventoy.net>
Wed, 21 Dec 2022 05:21:54 +0000 (13:21 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 21 Dec 2022 05:21:54 +0000 (13:21 +0800)
16 files changed:
Plugson/src/Core/ventoy_util_windows.c
Plugson/src/Web/ventoy_http.c
Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe
Plugson/vs/VentoyPlugson/x64/Release/VentoyPlugson_X64.exe
Plugson/www/buildtime
Plugson/www/index.html
Plugson/www/plugson_auto_install.html
Plugson/www/plugson_auto_memdisk.html
Plugson/www/plugson_dud.html
Plugson/www/plugson_image_list.html
Plugson/www/plugson_injection.html
Plugson/www/plugson_menu_alias.html
Plugson/www/plugson_menu_class.html
Plugson/www/plugson_menu_tip.html
Plugson/www/plugson_password.html
Plugson/www/plugson_persistence.html

index 1d8d97fc387c2b9189f1dc3291dee09241b6de40..6610894c0b259b63e15c89e7cd65b8a5014a6dbf 100644 (file)
@@ -638,7 +638,8 @@ int CheckRuntimeEnvironment(char Letter, ventoy_disk *disk)
         return 1;
     }
 
         return 1;
     }
 
-    if (_stricmp(FsName, "NTFS") == 0)
+    /* Fix: enable for all file system on Windows */
+    /* if (_stricmp(FsName, "NTFS") == 0) */
     {
         disk->pathcase = 1;
     }
     {
         disk->pathcase = 1;
     }
index aa1d87d4f7191e931d098cf6eb1e8c290df07cfd..2f1f88202e8a50b5b63321b037cf20fb0d7ade95 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <stdarg.h>
 #include <stdint.h>
 #include <string.h>
 #include <stdarg.h>
+#include <stddef.h>
 #include <errno.h>
 #include <time.h>
 
 #include <errno.h>
 #include <time.h>
 
@@ -97,6 +98,9 @@ static char *g_pub_save_buffer = NULL;
 static pthread_mutex_t g_api_mutex;
 static struct mg_context *g_ventoy_http_ctx = NULL;
 
 static pthread_mutex_t g_api_mutex;
 static struct mg_context *g_ventoy_http_ctx = NULL;
 
+#define ventoy_is_real_exist_common(xpath, xnode, xtype) \
+    ventoy_path_is_real_exist(xpath, xnode, offsetof(xtype, path), offsetof(xtype, next))
+
 static int ventoy_is_kbd_valid(const char *key)
 {
     int i = 0;
 static int ventoy_is_kbd_valid(const char *key)
 {
     int i = 0;
@@ -170,6 +174,40 @@ static void ventoy_free_path_node_list(path_node *list)
     }    
 }
 
     }    
 }
 
+static int ventoy_path_is_real_exist(const char *path, void *head, size_t pathoff, size_t nextoff)
+{
+    char *node = NULL;
+    const char *nodepath = NULL;
+    const char *realpath = NULL;
+    char pathbuf[MAX_PATH];
+
+    if (strchr(path, '*'))
+    {
+        return 0;
+    }
+
+    realpath = ventoy_real_path(path);
+    scnprintf(pathbuf, sizeof(pathbuf), "%s", realpath);
+
+    node = (char *)head;
+    while (node)
+    {
+        nodepath = node + pathoff;
+        if (NULL == strchr(nodepath, '*'))
+        {
+            realpath = ventoy_real_path(nodepath);
+            if (strcmp(pathbuf, realpath) == 0)
+            {
+                return 1;
+            }
+        }
+        
+        memcpy(&node, node + nextoff, sizeof(node));
+    }
+
+    return 0;
+}
+
 static path_node * ventoy_path_node_add_array(VTOY_JSON *array)
 {
     path_node *head = NULL;
 static path_node * ventoy_path_node_add_array(VTOY_JSON *array)
 {
     path_node *head = NULL;
@@ -913,16 +951,15 @@ static int ventoy_api_save_theme(struct mg_connection *conn, VTOY_JSON *json)
     return 0;
 }
 
     return 0;
 }
 
+
 static int ventoy_api_theme_add_file(struct mg_connection *conn, VTOY_JSON *json)
 {
     int ret;
     int index = 0;
     const char *path = NULL;
 static int ventoy_api_theme_add_file(struct mg_connection *conn, VTOY_JSON *json)
 {
     int ret;
     int index = 0;
     const char *path = NULL;
-    const char *realpath = NULL;
     path_node *node = NULL;
     path_node *cur = NULL;
     data_theme *data = NULL;
     path_node *node = NULL;
     path_node *cur = NULL;
     data_theme *data = NULL;
-    char pathbuf[MAX_PATH];
     
     vtoy_json_get_int(json, "index", &index);
     data = g_data_theme + index;
     
     vtoy_json_get_int(json, "index", &index);
     data = g_data_theme + index;
@@ -930,19 +967,12 @@ static int ventoy_api_theme_add_file(struct mg_connection *conn, VTOY_JSON *json
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
-        realpath = ventoy_real_path(path);
-        scnprintf(pathbuf, sizeof(pathbuf), "%s", realpath);
-    
-        for (node = data->filelist; node; node = node->next)
+        if (ventoy_is_real_exist_common(path, data->filelist, path_node))
         {
         {
-            realpath = ventoy_real_path(node->path);
-            if (strcmp(pathbuf, realpath) == 0)
-            {
-                ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
-                return 0;
-            }
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
         }
         }
-    
+
         node = zalloc(sizeof(path_node));
         if (node)
         {
         node = zalloc(sizeof(path_node));
         if (node)
         {
@@ -989,17 +1019,14 @@ static int ventoy_api_theme_del_file(struct mg_connection *conn, VTOY_JSON *json
     return 0;
 }
 
     return 0;
 }
 
-
 static int ventoy_api_theme_add_font(struct mg_connection *conn, VTOY_JSON *json)
 {
     int ret;
     int index = 0;
     const char *path = NULL;
 static int ventoy_api_theme_add_font(struct mg_connection *conn, VTOY_JSON *json)
 {
     int ret;
     int index = 0;
     const char *path = NULL;
-    const char *realpath = NULL;
     path_node *node = NULL;
     path_node *cur = NULL;
     data_theme *data = NULL;
     path_node *node = NULL;
     path_node *cur = NULL;
     data_theme *data = NULL;
-    char pathbuf[MAX_PATH];
 
     vtoy_json_get_int(json, "index", &index);
     data = g_data_theme + index;
 
     vtoy_json_get_int(json, "index", &index);
     data = g_data_theme + index;
@@ -1007,19 +1034,12 @@ static int ventoy_api_theme_add_font(struct mg_connection *conn, VTOY_JSON *json
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
-        realpath = ventoy_real_path(path);
-        scnprintf(pathbuf, sizeof(pathbuf), "%s", realpath);
-    
-        for (node = data->fontslist; node; node = node->next)
+        if (ventoy_is_real_exist_common(path, data->fontslist, path_node))
         {
         {
-            realpath = ventoy_real_path(node->path);
-            if (strcmp(pathbuf, realpath) == 0)
-            {
-                ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
-                return 0;
-            }
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
         }
         }
-        
+
         node = zalloc(sizeof(path_node));
         if (node)
         {
         node = zalloc(sizeof(path_node));
         if (node)
         {
@@ -1222,6 +1242,12 @@ static int ventoy_api_alias_add(struct mg_connection *conn, VTOY_JSON *json)
     alias = VTOY_JSON_STR_EX("alias");
     if (path && alias)
     {
     alias = VTOY_JSON_STR_EX("alias");
     if (path && alias)
     {
+        if (ventoy_is_real_exist_common(path, data->list, data_alias_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+
         node = zalloc(sizeof(data_alias_node));
         if (node)
         {
         node = zalloc(sizeof(data_alias_node));
         if (node)
         {
@@ -1467,6 +1493,12 @@ static int ventoy_api_tip_add(struct mg_connection *conn, VTOY_JSON *json)
     tip = VTOY_JSON_STR_EX("tip");
     if (path && tip)
     {
     tip = VTOY_JSON_STR_EX("tip");
     if (path && tip)
     {
+        if (ventoy_is_real_exist_common(path, data->list, data_tip_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+    
         node = zalloc(sizeof(data_tip_node));
         if (node)
         {
         node = zalloc(sizeof(data_tip_node));
         if (node)
         {
@@ -1816,6 +1848,12 @@ static int ventoy_api_auto_memdisk_add(struct mg_connection *conn, VTOY_JSON *js
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
+        if (ventoy_is_real_exist_common(path, data->list, path_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+
         node = zalloc(sizeof(path_node));
         if (node)
         {
         node = zalloc(sizeof(path_node));
         if (node)
         {
@@ -1998,6 +2036,12 @@ static int ventoy_api_image_list_add(struct mg_connection *conn, VTOY_JSON *json
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
     path = VTOY_JSON_STR_EX("path");
     if (path)
     {
+        if (ventoy_is_real_exist_common(path, data->list, path_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+
         node = zalloc(sizeof(path_node));
         if (node)
         {
         node = zalloc(sizeof(path_node));
         if (node)
         {
@@ -2253,6 +2297,12 @@ static int ventoy_api_password_add(struct mg_connection *conn, VTOY_JSON *json)
     pwd = VTOY_JSON_STR_EX("pwd");
     if (path && pwd)
     {
     pwd = VTOY_JSON_STR_EX("pwd");
     if (path && pwd)
     {
+        if (ventoy_is_real_exist_common(path, data->list, menu_password))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+
         node = zalloc(sizeof(menu_password));
         if (node)
         {
         node = zalloc(sizeof(menu_password));
         if (node)
         {
@@ -2658,6 +2708,12 @@ static int ventoy_api_dud_add(struct mg_connection *conn, VTOY_JSON *json)
     path = VTOY_JSON_STR_EX("path");
     if (path && array)
     {
     path = VTOY_JSON_STR_EX("path");
     if (path && array)
     {
+        if (ventoy_is_real_exist_common(path, data->list, dud_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+        
         node = zalloc(sizeof(dud_node));
         if (node)
         {
         node = zalloc(sizeof(dud_node));
         if (node)
         {
@@ -3013,6 +3069,12 @@ static int ventoy_api_auto_install_add(struct mg_connection *conn, VTOY_JSON *js
     path = VTOY_JSON_STR_EX("path");
     if (path && array)
     {
     path = VTOY_JSON_STR_EX("path");
     if (path && array)
     {
+        if (ventoy_is_real_exist_common(path, data->list, auto_install_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }     
+    
         node = zalloc(sizeof(auto_install_node));
         if (node)
         {
         node = zalloc(sizeof(auto_install_node));
         if (node)
         {
@@ -3355,6 +3417,12 @@ static int ventoy_api_persistence_add(struct mg_connection *conn, VTOY_JSON *jso
     path = VTOY_JSON_STR_EX("path");
     if (path && array)
     {
     path = VTOY_JSON_STR_EX("path");
     if (path && array)
     {
+        if (ventoy_is_real_exist_common(path, data->list, persistence_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+        
         node = zalloc(sizeof(persistence_node));
         if (node)
         {
         node = zalloc(sizeof(persistence_node));
         if (node)
         {
@@ -3648,6 +3716,12 @@ static int ventoy_api_injection_add(struct mg_connection *conn, VTOY_JSON *json)
     archive = VTOY_JSON_STR_EX("archive");
     if (path && archive)
     {
     archive = VTOY_JSON_STR_EX("archive");
     if (path && archive)
     {
+        if (ventoy_is_real_exist_common(path, data->list, injection_node))
+        {
+            ventoy_json_result(conn, VTOY_JSON_DUPLICATE);
+            return 0;
+        }
+    
         node = zalloc(sizeof(injection_node));
         if (node)
         {
         node = zalloc(sizeof(injection_node));
         if (node)
         {
index 72ec6e2a7d04e33a2453fe2930672083fd63c073..dc8b216601084ddaea049003e24265961c99da72 100644 (file)
Binary files a/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe and b/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe differ
index 043c1b45abe3c51945616c7f2f282ad30fe57386..4912f4088e45df24c0be825518a68fe3d1afbd99 100644 (file)
Binary files a/Plugson/vs/VentoyPlugson/x64/Release/VentoyPlugson_X64.exe and b/Plugson/vs/VentoyPlugson/x64/Release/VentoyPlugson_X64.exe differ
index 5d528f42de9c79be0cd229ca742dfd72a44cac9d..0dbb63cff9a5e825fbd2b4b4f1c229252d7e3a0e 100644 (file)
@@ -1 +1 @@
-20221220 18:30:51
\ No newline at end of file
+20221221 12:11:59
\ No newline at end of file
index 29f909f984ef3fe171e771310bb66c2d49385d8a..b5391fd7509610aceb3794d86061a38c1ac468fe 100644 (file)
 \r
         <footer class="main-footer">\r
             <div class="pull-right hidden-xs">\r
 \r
         <footer class="main-footer">\r
             <div class="pull-right hidden-xs">\r
-                <b id="plugson_build_date">20221220 19:41:37</b>
+                <b id="plugson_build_date">20221221 12:11:59</b>
             </div>\r
             <strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>\r
         </footer>\r
             </div>\r
             <strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>\r
         </footer>\r
     <script src="/static/js/jQuery-2.1.4.min.js"></script>\r
     <!-- jquery validate -->\r
     <script src="/static/js/jquery.validate.min.js"></script>    \r
     <script src="/static/js/jQuery-2.1.4.min.js"></script>\r
     <!-- jquery validate -->\r
     <script src="/static/js/jquery.validate.min.js"></script>    \r
-    <script src="/static/js/jquery.validate.vtoymethods.js?v=102"></script>\r
+    <script src="/static/js/jquery.validate.vtoymethods.js?v=103"></script>\r
 \r
 \r
-    <script src="/static/js/jquery.vtoy.alert.js?v=102"></script>\r
-    <script src="/static/js/vtoy.js?v=102"></script>\r
+    <script src="/static/js/jquery.vtoy.alert.js?v=103"></script>\r
+    <script src="/static/js/vtoy.js?v=103"></script>\r
     <script src="/static/js/md5.min.js"></script>\r
 \r
     <!-- Bootstrap 3.3.5 -->\r
     <script src="/static/js/md5.min.js"></script>\r
 \r
     <!-- Bootstrap 3.3.5 -->\r
index 4014e101b892cdd642aaafc2aa09618d8e396561..a8e45bcf8ab58adc1c192c8d73dfe72941b457d7 100644 (file)
       template: call_array,\r
       type: type\r
     }, function(e) {\r
       template: call_array,\r
       type: type\r
     }, function(e) {\r
-      list.push(data);\r
-      FillAutoInsTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillAutoInsTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index 14ed690d0581677c3126cf379457550de468e9fc..96bac5b30f28dde1763ce3c1ed33ff5b0fba11e3 100644 (file)
       index: current_tab_index,\r
       path: data.path,\r
     }, function(e) {\r
       index: current_tab_index,\r
       path: data.path,\r
     }, function(e) {\r
-      list.push(data);\r
-      FillMemdiskTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillMemdiskTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index 426400e716efe730323152096d7268c348aa4921..4c172af86e39fee9a980268af06ecd6cf64e54a1 100644 (file)
       dud: call_array,\r
       type: type\r
     }, function(e) {\r
       dud: call_array,\r
       type: type\r
     }, function(e) {\r
-      list.push(data);\r
-      FillDudTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillDudTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index fbbcf07f5641a5ce9f6a90658312e79078a221cb..8d702f4d223aefbd7269e04e186e8843232b6fd8 100644 (file)
       index: current_tab_index,\r
       path: data.path,\r
     }, function(e) {\r
       index: current_tab_index,\r
       path: data.path,\r
     }, function(e) {\r
-      list.push(data);\r
-      FillImageListTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillImageListTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index bd8e6d56400430dc426e9d92742b365cdbfb539e..17055ad2f80e12ce46e0367b8150085069830928 100644 (file)
       archive: data.archive,\r
       type: type\r
     }, function(e) {\r
       archive: data.archive,\r
       type: type\r
     }, function(e) {\r
-      list.push(data);\r
-      FillInjectionTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillInjectionTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index ed7d27bb24360957cb0477b326c3f1b2320b7163..2e275d359c17e92700e156cb5d9a612f2f5568a2 100644 (file)
       alias: data.alias,\r
       type: type\r
     }, function(e) {\r
       alias: data.alias,\r
       type: type\r
     }, function(e) {\r
-      list.push(data);\r
-      FillAliasTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillAliasTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }      \r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index f230935690df0107a7488e75c94e20fa1ec37239..0a14dc453c1e5c1080e263fb82e05586fc3e2cd7 100644 (file)
       class: data.class,\r
       type: type\r
     }, function(e) {\r
       class: data.class,\r
       type: type\r
     }, function(e) {\r
-      list.push(data);\r
-      FillClassTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillClassTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index 214a43eb147f624a2ff07c7865f4b2cb059ff710..75ef808679e86dd725ddc5547062af5b841c6c56 100644 (file)
       tip: data.tip,\r
       type: type\r
     }, function(e) {\r
       tip: data.tip,\r
       type: type\r
     }, function(e) {\r
-      list.push(data);\r
-      FillTipTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillTipTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r
index 97cdc68db0c58c0a4edfeac2785e54bda094d27d..bca84bc92e5fcf8cbef16b749cabf5fe1f21828b 100644 (file)
@@ -464,9 +464,13 @@ function VtoySetPassword(common, type, cb, data) {
       path: data.path,\r
       pwd: data.pwd\r
     }, function(e) {\r
       path: data.path,\r
       pwd: data.pwd\r
     }, function(e) {\r
-      list.push(data);\r
-      FillMenuPwdTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillMenuPwdTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
 \r
   }\r
     });\r
 \r
   }\r
index d5a4c076240d8ff9a2cd48ef520c00a6afcd223d..37359ab81e44fec02885195e37b102e3b2448430 100644 (file)
       backend: call_array,\r
       type: type\r
     }, function(e) {\r
       backend: call_array,\r
       type: type\r
     }, function(e) {\r
-      list.push(data);\r
-      FillPersistenceTable(list);\r
-      Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      if (e.result === 'success') {\r
+        list.push(data);\r
+        FillPersistenceTable(list);\r
+        Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);\r
+      } else if (e.result === 'duplicate') {\r
+        Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);\r
+      }\r
     });\r
   }\r
 \r
     });\r
   }\r
 \r