about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorPhilip Flohr <philip.flohr@student.kit.edu>2018-05-07 18:13:27 +0200
committerDmitry Podgorny <pasis.ua@gmail.com>2018-09-06 19:28:02 +0300
commitadb4955c34bd1cddda7482d214787a918d28171b (patch)
treeec7f94b960f3af90171adbe1db3ca29e83d887b1 /src
parent33e9af410079e9fa19f18d4a012ffa47dd5089a5 (diff)
downloadprofani-tty-adb4955c34bd1cddda7482d214787a918d28171b.tar.gz
Fail plugin installation if the target file already exists
Diffstat (limited to 'src')
-rw-r--r--src/plugins/plugins.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c
index ced170fe..d10cf5b8 100644
--- a/src/plugins/plugins.c
+++ b/src/plugins/plugins.c
@@ -175,6 +175,12 @@ plugins_install(const char *const plugin_name, const char *const filename)
     g_string_append(target_path, "/");
     g_string_append(target_path, plugin_name);
 
+    if (g_file_test (filename,G_FILE_TEST_EXISTS))
+    {
+        log_info("Failed to install plugin: %s, file exists", plugin_name);
+        return FALSE;
+    }
+
     ProfPlugin *plugin = g_hash_table_lookup(plugins, plugin_name);
     if (plugin) {
         plugins_unload(plugin_name);