1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-18 06:04:06 +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/common.h"
#include "common/logging.h"
#include "common/path.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 (ctdb->public_addresses_file == NULL) {
const char *b = getenv("CTDB_BASE");
if (b == NULL) {
DBG_ERR("CTDB_BASE not set\n");
return -1;
}
ctdb->public_addresses_file = talloc_asprintf(
ctdb, "%s/%s", b, "public_addresses");
ctdb->public_addresses_file = path_etcdir_append(
ctdb, "public_addresses");
if (ctdb->public_addresses_file == NULL) {
DBG_ERR("Out of memory\n");
return -1;

View File

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