summaryrefslogtreecommitdiff
path: root/source3/lib
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/lib
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/lib')
-rw-r--r--source3/lib/netapi/serverinfo.c4
-rw-r--r--source3/lib/smbldap.c3
-rw-r--r--source3/lib/sysquotas.c4
-rw-r--r--source3/lib/util.c4
4 files changed, 8 insertions, 7 deletions
diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c
index 4b11339f94..046b693f1f 100644
--- a/source3/lib/netapi/serverinfo.c
+++ b/source3/lib/netapi/serverinfo.c
@@ -40,7 +40,7 @@ static WERROR NetServerGetInfo_l_101(struct libnetapi_ctx *ctx,
i.sv101_version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
i.sv101_version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
i.sv101_type = lp_default_server_announce();
- i.sv101_comment = lp_serverstring();
+ i.sv101_comment = lp_serverstring(ctx);
*buffer = (uint8_t *)talloc_memdup(ctx, &i, sizeof(i));
if (!*buffer) {
@@ -58,7 +58,7 @@ static WERROR NetServerGetInfo_l_1005(struct libnetapi_ctx *ctx,
{
struct SERVER_INFO_1005 info1005;
- info1005.sv1005_comment = lp_serverstring();
+ info1005.sv1005_comment = lp_serverstring(ctx);
*buffer = (uint8_t *)talloc_memdup(ctx, &info1005, sizeof(info1005));
if (!*buffer) {
return WERR_NOMEM;
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 81276936e6..85a9ac557f 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -1626,7 +1626,8 @@ int smbldap_search_suffix (struct smbldap_state *ldap_state,
const char *filter, const char **search_attr,
LDAPMessage ** result)
{
- return smbldap_search(ldap_state, lp_ldap_suffix(), LDAP_SCOPE_SUBTREE,
+ return smbldap_search(ldap_state, lp_ldap_suffix(talloc_tos()),
+ LDAP_SCOPE_SUBTREE,
filter, search_attr, 0, result);
}
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c
index 12c34edaa2..08f8444e2f 100644
--- a/source3/lib/sysquotas.c
+++ b/source3/lib/sysquotas.c
@@ -188,7 +188,7 @@ static int command_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t
const char *get_quota_command;
char **lines = NULL;
- get_quota_command = lp_get_quota_command();
+ get_quota_command = lp_get_quota_command(talloc_tos());
if (get_quota_command && *get_quota_command) {
const char *p;
char *p2;
@@ -332,7 +332,7 @@ static int command_set_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t
{
const char *set_quota_command;
- set_quota_command = lp_set_quota_command();
+ set_quota_command = lp_set_quota_command(talloc_tos());
if (set_quota_command && *set_quota_command) {
char **lines = NULL;
char *syscmd = NULL;
diff --git a/source3/lib/util.c b/source3/lib/util.c
index fa46448296..9c380c5a02 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -669,7 +669,7 @@ char *automount_lookup(TALLOC_CTX *ctx, const char *user_name)
char *nis_result; /* yp_match inits this */
int nis_result_len; /* and set this */
char *nis_domain; /* yp_get_default_domain inits this */
- char *nis_map = (char *)lp_nis_home_map_name();
+ char *nis_map = lp_nis_home_map_name(talloc_tos());
if ((nis_error = yp_get_default_domain(&nis_domain)) != 0) {
DEBUG(3, ("YP Error: %s\n", yperr_string(nis_error)));
@@ -899,7 +899,7 @@ void smb_panic_s3(const char *why)
prctl(PR_SET_PTRACER, getpid(), 0, 0, 0);
#endif
- cmd = lp_panic_action();
+ cmd = lp_panic_action(talloc_tos());
if (cmd && *cmd) {
DEBUG(0, ("smb_panic(): calling panic action [%s]\n", cmd));
result = system(cmd);