From 2203228c791761bcab07961da725488636bee8df Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 14 Jul 2006 22:06:38 +0000 Subject: r17039: Eliminate snum from enumshares and getshareinfo. Get rid of some pstrings. Volker (This used to be commit c5e393d5eda4e13a844171d9ff319d1f1bac3d84) --- source3/lib/substitute.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'source3/lib') diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 430c8029b8..25a6a2c4c8 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -665,7 +665,7 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx, /**************************************************************************** ****************************************************************************/ -char *alloc_sub_advanced(const char *servicename, const char *user, +static char *alloc_sub_advanced(const char *servicename, const char *user, const char *connectpath, gid_t gid, const char *smb_name, const char *domain_name, const char *str) @@ -731,6 +731,29 @@ char *alloc_sub_advanced(const char *servicename, const char *user, return ret_string; } +/* + * This obviously is inefficient and needs to be merged into + * alloc_sub_advanced... + */ + +char *talloc_sub_advanced(TALLOC_CTX *mem_ctx, + const char *servicename, const char *user, + const char *connectpath, gid_t gid, + const char *smb_name, const char *domain_name, + const char *str) +{ + char *a, *t; + + if (!(a = alloc_sub_advanced(servicename, user, connectpath, gid, + smb_name, domain_name, str))) { + return NULL; + } + t = talloc_strdup(mem_ctx, a); + SAFE_FREE(a); + return t; +} + + void standard_sub_advanced(const char *servicename, const char *user, const char *connectpath, gid_t gid, const char *smb_name, const char *domain_name, -- cgit