mirror of
https://github.com/pumpitupdev/pumptools.git
synced 2026-10-11 08:38:10 +03:00
fix: harden shared IO library path lookup
PR #86 derives the mapping-file directory from dladdr's dli_fname. The initial implementation assumes that the resolved name contains a directory separator. If the loader returns a bare soname, the truncation loop reduces it to its first character and reports success, causing a bogus mapping-file lookup instead of using the executable-directory fallback. Locate the final separator before copying, preserve the filesystem root, reject names that do not identify a directory, and validate the length of the returned directory rather than requiring room for the complete library filename. Link the four PIUIO and PIUBTN keyboard and joystick targets directly with libdl so their dladdr dependency remains explicit on the supported older glibc environment.
This commit is contained in:
committed by
voidderef
parent
7a72487742
commit
9c1983a9e4
@@ -12,4 +12,4 @@ set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
|
||||
# Remove library name "lib" prefix
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-joystick-util io-util util)
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-joystick-util io-util util dl)
|
||||
|
||||
@@ -12,4 +12,4 @@ set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
|
||||
# Remove library name "lib" prefix
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-keyboard-util io-util util)
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piubtn-keyboard-util io-util util dl)
|
||||
|
||||
@@ -12,4 +12,4 @@ set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
|
||||
# Remove library name "lib" prefix
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-joystick-util io-util util)
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-joystick-util io-util util dl)
|
||||
|
||||
@@ -12,4 +12,4 @@ set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-fPIC")
|
||||
# Remove library name "lib" prefix
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-keyboard-util io-util util)
|
||||
target_link_libraries(${PROJECT_NAME} ptapi-io-piuio-keyboard-util io-util util dl)
|
||||
|
||||
Reference in New Issue
Block a user