1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

ctdb-daemon: Use path_etcdir_append() to construct some paths

No need to use CTDB_BASE directly.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
This commit is contained in:
Martin Schwenke 2024-08-06 13:49:01 +10:00 committed by Anoop C S
parent 3b613a085b
commit b6151faf45
2 changed files with 5 additions and 13 deletions

View File

@ -44,6 +44,7 @@
#include "common/system_socket.h" #include "common/system_socket.h"
#include "common/common.h" #include "common/common.h"
#include "common/logging.h" #include "common/logging.h"
#include "common/path.h"
#include "conf/ctdb_config.h" #include "conf/ctdb_config.h"
@ -1145,13 +1146,8 @@ int ctdb_set_public_addresses(struct ctdb_context *ctdb)
/* If no public addresses file given then try the default */ /* If no public addresses file given then try the default */
if (ctdb->public_addresses_file == NULL) { if (ctdb->public_addresses_file == NULL) {
const char *b = getenv("CTDB_BASE"); ctdb->public_addresses_file = path_etcdir_append(
if (b == NULL) { ctdb, "public_addresses");
DBG_ERR("CTDB_BASE not set\n");
return -1;
}
ctdb->public_addresses_file = talloc_asprintf(
ctdb, "%s/%s", b, "public_addresses");
if (ctdb->public_addresses_file == NULL) { if (ctdb->public_addresses_file == NULL) {
DBG_ERR("Out of memory\n"); DBG_ERR("Out of memory\n");
return -1; return -1;

View File

@ -372,17 +372,13 @@ int main(int argc, const char *argv[])
ctdb_tunables_load(ctdb); ctdb_tunables_load(ctdb);
ctdb->event_script_dir = talloc_asprintf(ctdb, ctdb->event_script_dir = path_etcdir_append(ctdb, "events/legacy");
"%s/events/legacy",
ctdb_base);
if (ctdb->event_script_dir == NULL) { if (ctdb->event_script_dir == NULL) {
DBG_ERR("Out of memory\n"); DBG_ERR("Out of memory\n");
goto fail; goto fail;
} }
ctdb->notification_script = talloc_asprintf(ctdb, ctdb->notification_script = path_etcdir_append(ctdb, "notify.sh");
"%s/notify.sh",
ctdb_base);
if (ctdb->notification_script == NULL) { if (ctdb->notification_script == NULL) {
D_ERR("Unable to set notification script\n"); D_ERR("Unable to set notification script\n");
goto fail; goto fail;