summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
commitfe72740e8221575921c22030d6d4fcb19201b03b (patch)
tree0b1bb254e23d6541eede8f2ff4494af477fd5566 /source3/nmbd
parentc809eec53fb1d2a36909e4934dff349f91e3359e (diff)
downloadsamba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.gz
samba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.bz2
samba-fe72740e8221575921c22030d6d4fcb19201b03b.zip
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 <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd.c4
-rw-r--r--source3/nmbd/nmbd_sendannounce.c7
-rw-r--r--source3/nmbd/nmbd_serverlistdb.c2
-rw-r--r--source3/nmbd/nmbd_winsserver.c2
-rw-r--r--source3/nmbd/nmbd_workgroupdb.c2
5 files changed, 9 insertions, 8 deletions
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));
}