summaryrefslogtreecommitdiff
path: root/libdecor/src/libdecor.c
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-21 15:11:10 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-09-21 15:11:10 +0200
commit75dd467dc5f85b66c00a6e6bc8fe177395a0a074 (patch)
tree083501b49846fe13f6ee5e171aac6ee7e8614702 /libdecor/src/libdecor.c
parenta2bf4d7ef291c4a2ffcc4931d07fc00c307efc8d (diff)
Update with changes from source (commit bcb1d791) - cont'd.
Diffstat (limited to 'libdecor/src/libdecor.c')
-rw-r--r--libdecor/src/libdecor.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libdecor/src/libdecor.c b/libdecor/src/libdecor.c
index 9bd418fe2..7d48d1427 100644
--- a/libdecor/src/libdecor.c
+++ b/libdecor/src/libdecor.c
@@ -1,6 +1,7 @@
/*
* Copyright © 2017-2018 Red Hat Inc.
* Copyright © 2018 Jonas Ådahl
+ * Copyright © 2019 Christian Rauch
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -1387,6 +1388,24 @@ calculate_priority(const struct libdecor_plugin_description *plugin_description)
return -1;
}
+static bool
+check_symbol_conflicts(const struct libdecor_plugin_description *plugin_description)
+{
+ char * const *symbol;
+
+ symbol = plugin_description->conflicting_symbols;
+ while (*symbol) {
+ dlerror();
+ dlsym (RTLD_DEFAULT, *symbol);
+ if (!dlerror())
+ return false;
+
+ symbol++;
+ }
+
+ return true;
+}
+
static struct plugin_loader *
load_plugin_loader(struct libdecor *context,
const char *path,
@@ -1438,6 +1457,11 @@ load_plugin_loader(struct libdecor *context,
return NULL;
}
+ if (!check_symbol_conflicts(plugin_description)) {
+ dlclose(lib);
+ return NULL;
+ }
+
priority = calculate_priority(plugin_description);
if (priority == -1) {
fprintf(stderr,