diff options
author | Bernd Schubert <bernd@bsbernd.com> | 2025-01-04 23:18:14 +0100 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-01-06 13:40:18 +0100 |
commit | fc95fd5076fd845e496bfbcec1ad9da16534b1c9 (patch) | |
tree | 33a262883950fab4717f531084c63a9edd235ded /lib | |
parent | a1e5aded5942e78472e6d60846a3f4e769d13680 (diff) | |
download | libfuse-fc95fd5076fd845e496bfbcec1ad9da16534b1c9.tar.gz |
Make fuse_main_real() not symboled
Addresses https://github.com/libfuse/libfuse/issues/1092
We actually don't need to make fuse_main_real() symboled, as it
is not part of the official API.
The inlined function now always calls into fuse_main_real_317
and the compat ABI function (which should also be available
for dlopen/dlsym) is now always compiled, independent if the
compiler/linker support versioned symbols.
Additionally, fuse_main_real() is also declared as inlined
function and a warning message is created when that function
is called.
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compat.c | 23 | ||||
-rw-r--r-- | lib/fuse_versionscript | 2 | ||||
-rw-r--r-- | lib/helper.c | 8 |
3 files changed, 16 insertions, 17 deletions
diff --git a/lib/compat.c b/lib/compat.c index ce8a933..6852299 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -18,6 +18,7 @@ #include "libfuse_config.h" #include <stddef.h> +#include <stdint.h> struct fuse_args; struct fuse_cmdline_opts; @@ -59,16 +60,6 @@ int fuse_session_custom_io(struct fuse_session *se, return fuse_session_custom_io_30(se, io, fd); } -int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op, - size_t op_size, void *user_data); -int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op, - size_t op_size, void *user_data); -int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op, - size_t op_size, void *user_data) -{ - return fuse_main_real_30(argc, argv, op, op_size, user_data); -} - struct fuse_session *fuse_session_new_30(struct fuse_args *args, const struct fuse_lowlevel_ops *op, size_t op_size, void *userdata); @@ -82,6 +73,14 @@ struct fuse_session *fuse_session_new(struct fuse_args *args, return fuse_session_new_30(args, op, op_size, userdata); } -#endif - +#endif /* LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS */ +int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op, + size_t op_size, void *user_data); +int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op, + size_t op_size, void *user_data); +int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op, + size_t op_size, void *user_data) +{ + return fuse_main_real_30(argc, argv, op, op_size, user_data); +} diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index f20e2b4..78df3f0 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -189,10 +189,10 @@ FUSE_3.12 { FUSE_3.17 { global: + fuse_main_real_317; #if !defined(LIBFUSE_BUILT_WITH_VERSIONED_SYMBOLS) _fuse_session_new_317; _fuse_new_317; - fuse_main_real_317; #endif fuse_passthrough_open; fuse_passthrough_close; diff --git a/lib/helper.c b/lib/helper.c index 2794e66..660f029 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -304,9 +304,10 @@ int fuse_daemonize(int foreground) return 0; } +/* Not symboled, as not part of the official API */ int fuse_main_real_317(int argc, char *argv[], const struct fuse_operations *op, - size_t op_size, struct libfuse_version *version, void *user_data); -FUSE_SYMVER("fuse_main_real_317", "fuse_main_real@@FUSE_3.17") + size_t op_size, struct libfuse_version *version, + void *user_data); int fuse_main_real_317(int argc, char *argv[], const struct fuse_operations *op, size_t op_size, struct libfuse_version *version, void *user_data) { @@ -400,14 +401,13 @@ out1: return res; } +/* Not symboled, as not part of the official API */ int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op, size_t op_size, void *user_data); -FUSE_SYMVER("fuse_main_real_30", "fuse_main_real@FUSE_3.0") int fuse_main_real_30(int argc, char *argv[], const struct fuse_operations *op, size_t op_size, void *user_data) { struct libfuse_version version = { 0 }; - return fuse_main_real_317(argc, argv, op, op_size, &version, user_data); } |