From fe72740e8221575921c22030d6d4fcb19201b03b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 18 Jul 2012 15:07:23 +0930 Subject: loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *. They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell --- source3/nmbd/nmbd.c | 4 ++-- source3/nmbd/nmbd_sendannounce.c | 7 ++++--- source3/nmbd/nmbd_serverlistdb.c | 2 +- source3/nmbd/nmbd_winsserver.c | 2 +- source3/nmbd/nmbd_workgroupdb.c | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index d464e7e0f6..ebe83a6147 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -382,7 +382,7 @@ static bool reload_nmbd_services(bool test) set_remote_machine_name("nmbd", False); if ( lp_loaded() ) { - char *fname = lp_configfile(); + char *fname = lp_configfile(talloc_tos()); if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) { set_dyn_CONFIGFILE(fname); test = False; @@ -843,7 +843,7 @@ static bool open_sockets(bool isdaemon, int port) } fault_setup(); - dump_core_setup("nmbd", lp_logfile()); + dump_core_setup("nmbd", lp_logfile(talloc_tos())); /* POSIX demands that signals are inherited. If the invoking process has * these signals masked, we will have problems, as we won't receive them. */ diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c index 39e63d29ab..97bab9d25a 100644 --- a/source3/nmbd/nmbd_sendannounce.c +++ b/source3/nmbd/nmbd_sendannounce.c @@ -470,11 +470,12 @@ void announce_remote(time_t t) last_time = t; - s = lp_remote_announce(); + s = lp_remote_announce(talloc_tos()); if (!*s) return; - comment = string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH); + comment = string_truncate(lp_serverstring(talloc_tos()), + MAX_SERVER_STRING_LENGTH); frame = talloc_stackframe(); for (ptr=s; next_token_talloc(frame,&ptr,&s2,NULL); ) { @@ -540,7 +541,7 @@ void browse_sync_remote(time_t t) last_time = t; - s = lp_remote_browse_sync(); + s = lp_remote_browse_sync(talloc_tos()); if (!*s) return; diff --git a/source3/nmbd/nmbd_serverlistdb.c b/source3/nmbd/nmbd_serverlistdb.c index 01627c3331..ac16b5a98c 100644 --- a/source3/nmbd/nmbd_serverlistdb.c +++ b/source3/nmbd/nmbd_serverlistdb.c @@ -355,7 +355,7 @@ void write_browse_list(time_t t, bool force_write) /* Output server details, plus what workgroup they're in. */ write_browse_list_entry(fp, my_netbios_names(i), stype, - string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH), lp_workgroup()); + string_truncate(lp_serverstring(talloc_tos()), MAX_SERVER_STRING_LENGTH), lp_workgroup()); } for (subrec = FIRST_SUBNET; subrec ; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) { diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index ff5fae70b1..87b9990a63 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -461,7 +461,7 @@ static void get_global_id_and_update(uint64_t *current_id, bool update) static void wins_hook(const char *operation, struct name_record *namerec, int ttl) { char *command = NULL; - char *cmd = lp_wins_hook(); + char *cmd = lp_wins_hook(talloc_tos()); char *p, *namestr; int i; TALLOC_CTX *ctx = talloc_tos(); diff --git a/source3/nmbd/nmbd_workgroupdb.c b/source3/nmbd/nmbd_workgroupdb.c index 43a28aa669..14b33b321e 100644 --- a/source3/nmbd/nmbd_workgroupdb.c +++ b/source3/nmbd/nmbd_workgroupdb.c @@ -254,7 +254,7 @@ workgroup %s on subnet %s\n", work->work_group, subrec->subnet_name)); stype &= ~(SV_TYPE_MASTER_BROWSER|SV_TYPE_POTENTIAL_BROWSER|SV_TYPE_DOMAIN_MASTER|SV_TYPE_DOMAIN_MEMBER); create_server_on_workgroup(work,name,stype|SV_TYPE_LOCAL_LIST_ONLY, PERMANENT_TTL, - string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH)); + string_truncate(lp_serverstring(talloc_tos()), MAX_SERVER_STRING_LENGTH)); DEBUG(3,("initiate_myworkgroup_startup: Added server name entry %s \ on subnet %s\n", name, subrec->subnet_name)); } -- cgit