opensciencegrid / xrootd-multiuser

A filesystem plugin to allow Xrootd write as a different Unix user
Apache License 2.0
2 stars 12 forks source link

Fails with xrootd-5 unless built as libXrdMultiuser-5.so #7

Open ddavila0 opened 4 years ago

ddavila0 commented 4 years ago

When I was testing this plugin with xrootd-5.0.0-rc2, I noticed it failed to load it. The xrootd directive was xrootd.fslib libXrdMultiuser.so default and the error was[1]. Then I tried to force it to use libXrdMultiuser-4.so by changing the directive to: xrootd.fslib libXrdMultiuser-4.so and got the following error[2]. Finally I patched the code to build libXrdMultiuser-5.so instead and this time it worked but I assume this will make xrootd-4 to fail (not tested) so I'm not sure what would be the best way to solve this issue

=====> xrootd.fslib libXrdMultiuser.so default
Plugin No such file or directory loading fslib libXrdMultiuser-5.so
Config Falling back to using libXrdMultiuser.so
Plugin No such file or directory loading fslib libXrdMultiuser.so
Config Unable to load fslib plugin libXrdMultiuser.so
=====> xrootd.fslib libXrdMultiuser-4.so
Config fslib plugin libXrdMultiuser-4.so specifies a version (i.e. '-n.so'); automatic version selection disabled!
Plugin loaded unreleased Multiuser v5.0.0-rc2 from fslib libXrdMultiuser-4.so
200414 13:32:07 6805 XrootdConfig: Unable to load file system via libXrdMultiuser-4.so
200414 13:32:07 6805 XrootdConfig: Unable to load base file system using libXrdMultiuser-4.so
djw8605 commented 4 years ago

What was the patch?

ddavila0 commented 4 years ago

Author: Diego Davila <davila.foyo@gmail.com>
Date:   Mon Apr 6 14:54:17 2020 -0500

    compile library as -5 instead of -4

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43adfe9..8b578a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,7 +31,7 @@ include_directories(${XROOTD_INCLUDES})

 add_library(XrdMultiuser SHARED src/multiuser.cpp)
 target_link_libraries(XrdMultiuser -ldl ${CAP_LIB} ${XROOTD_UTILS_LIB} ${XROOTD_SERVER_LIB})
-set_target_properties(XrdMultiuser PROPERTIES OUTPUT_NAME "XrdMultiuser-4" SUFFIX ".so" LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/configs/export-lib-symbols")
+set_target_properties(XrdMultiuser PROPERTIES OUTPUT_NAME "XrdMultiuser-5" SUFFIX ".so" LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/configs/export-lib-symbols")

 SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Install path for libraries")
djw8605 commented 4 years ago

So simply change the output name is all it took to fix things? no API changes?

ddavila0 commented 4 years ago

yes, I know it's weird