Skip to content

Commit 6f778b5

Browse files
ekoopsleogr
authored andcommitted
fix(pkg/loader): isolate CGO inside an .so from the outer one
Signed-off-by: Leonardo Di Giovanna <[email protected]> Co-authored-by: Leonardo Grasso <[email protected]>
1 parent 88c32af commit 6f778b5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/loader/plugin_loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ plugin_handle_t* plugin_load(const char* path, char* err) {
112112
}
113113
}
114114
#else
115-
ret->handle = dlopen(path, RTLD_LAZY);
115+
ret->handle = dlopen(path, RTLD_LAZY|RTLD_DEEPBIND);
116116
if(ret->handle == NULL) {
117117
plugin_loader_strlcpy(err, (const char*)dlerror(), PLUGIN_MAX_ERRLEN);
118118
}

pkg/loader/strlcpy.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ index 2943335..7bebeeb 100644
8080
}
8181
}
8282
#else
83-
ret->handle = dlopen(path, RTLD_LAZY);
83+
ret->handle = dlopen(path, RTLD_LAZY|RTLD_DEEPBIND);
8484
if(ret->handle == NULL) {
8585
- strlcpy(err, (const char*)dlerror(), PLUGIN_MAX_ERRLEN);
8686
+ plugin_loader_strlcpy(err, (const char*)dlerror(), PLUGIN_MAX_ERRLEN);

0 commit comments

Comments
 (0)