mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 17:36:22 +00:00
Fail plugin installation if the target file already exists
This commit is contained in:
committed by
Dmitry Podgorny
parent
33e9af4100
commit
adb4955c34
@@ -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, "/");
|
||||||
g_string_append(target_path, plugin_name);
|
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);
|
ProfPlugin *plugin = g_hash_table_lookup(plugins, plugin_name);
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
plugins_unload(plugin_name);
|
plugins_unload(plugin_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user