Skip to content

Fix the hardcoded legacy helper path #60

Description

@hbai

Got the below issue:
~# drbdadm --version
execvp() failed to exec drbdadm-84: No such file or directory

The legacy helper path was hardcoded to "/lib/drbd", which does not exist
on systems where LIBDIR is configured to a different location (e.g.
/usr/lib). This caused drbdadm to fail when attempting to exec drbdadm-84.

Line 333 in user/v9/drbdtool_common.c:
void add_lib_drbd_to_path(void)
{
/* TODO: if exec-prefix != "/" ? */
add_component_to_path("/lib/drbd");
}

Plan to fix with below code change:

--- user/v9/Makefile.in
+++ user/v9/Makefile.in
@@ -72,6 +72,7 @@
 ifeq ($(WITH_84_SUPPORT),yes)
 CFLAGS += -DWITH_84_SUPPORT
+CFLAGS += -DDRBD_LEGACY_LIB_DIR=\"$(LIBDIR)\"
 endif
 CFLAGS += $(EXTRA_CFLAGS)

--- user/v9/drbdtool_common.c
+++ user/v9/drbdtool_common.c
@@ -333,7 +333,7 @@
 void add_lib_drbd_to_path(void)
 {
-               /* TODO: if exec-prefix != "/" ? */
-       add_component_to_path("/lib/drbd");
+       add_component_to_path(DRBD_LEGACY_LIB_DIR);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions