[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sat Nov 21 12:54:53 MST 2009
The branch, master has been updated
via cf2febf... s3: Make alloc_sub_basic() static
from c85a4c9... s3: Move the global variable Protocol to struct smbd_server_connection
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit cf2febf3d1c591effc036a44eb0870aaf95c6848
Author: Volker Lendecke <vl at samba.org>
Date: Sat Nov 21 20:23:35 2009 +0100
s3: Make alloc_sub_basic() static
-----------------------------------------------------------------------
Summary of changes:
source3/include/proto.h | 2 --
source3/lib/substitute.c | 7 +++++--
source3/param/loadparm.c | 33 +++++++++++++++++----------------
3 files changed, 22 insertions(+), 20 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8cf4769..6a5b3ec 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -794,8 +794,6 @@ void standard_sub_basic(const char *smb_name, const char *domain_name,
char *str, size_t len);
char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name,
const char *domain_name, const char *str);
-char *alloc_sub_basic(const char *smb_name, const char *domain_name,
- const char *str);
char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
const char *input_string,
const char *username,
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 55acdd9..64ef95a 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -21,6 +21,9 @@
#include "includes.h"
+static char *alloc_sub_basic(const char *smb_name, const char *domain_name,
+ const char *str);
+
userdom_struct current_user_info;
fstring remote_proto="UNKNOWN";
@@ -544,8 +547,8 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name,
/****************************************************************************
****************************************************************************/
-char *alloc_sub_basic(const char *smb_name, const char *domain_name,
- const char *str)
+static char *alloc_sub_basic(const char *smb_name, const char *domain_name,
+ const char *str)
{
char *b, *p, *s, *r, *a_string;
fstring pidstr, vnnstr;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 17a4e2d..b7eb80e 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -7074,7 +7074,6 @@ bool lp_file_list_changed(void)
DEBUG(6, ("lp_file_list_changed()\n"));
while (f) {
- char *n2 = NULL;
time_t mod_time;
if (strequal(f->name, INCLUDE_REGISTRY_NAME)) {
@@ -7090,9 +7089,11 @@ bool lp_file_list_changed(void)
return true;
}
} else {
- n2 = alloc_sub_basic(get_current_username(),
- current_user_info.domain,
- f->name);
+ char *n2 = NULL;
+ n2 = talloc_sub_basic(talloc_tos(),
+ get_current_username(),
+ current_user_info.domain,
+ f->name);
if (!n2) {
return false;
}
@@ -7116,7 +7117,7 @@ bool lp_file_list_changed(void)
above. */
return true;
}
- SAFE_FREE(n2);
+ TALLOC_FREE(n2);
}
f = f->next;
}
@@ -7133,12 +7134,12 @@ bool lp_file_list_changed(void)
static bool handle_netbios_name(int snum, const char *pszParmValue, char **ptr)
{
bool ret;
- char *netbios_name = alloc_sub_basic(get_current_username(),
- current_user_info.domain,
- pszParmValue);
+ char *netbios_name = talloc_sub_basic(
+ talloc_tos(), get_current_username(), current_user_info.domain,
+ pszParmValue);
ret = set_global_myname(netbios_name);
- SAFE_FREE(netbios_name);
+ TALLOC_FREE(netbios_name);
string_set(&Globals.szNetbiosName,global_myname());
DEBUG(4, ("handle_netbios_name: set global_myname to: %s\n",
@@ -7217,9 +7218,9 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr)
}
}
- fname = alloc_sub_basic(get_current_username(),
- current_user_info.domain,
- pszParmValue);
+ fname = talloc_sub_basic(talloc_tos(), get_current_username(),
+ current_user_info.domain,
+ pszParmValue);
add_to_file_list(pszParmValue, fname);
@@ -7230,12 +7231,12 @@ static bool handle_include(int snum, const char *pszParmValue, char **ptr)
include_depth++;
ret = pm_process(fname, do_section, do_parameter, NULL);
include_depth--;
- SAFE_FREE(fname);
+ TALLOC_FREE(fname);
return ret;
}
DEBUG(2, ("Can't find include file %s\n", fname));
- SAFE_FREE(fname);
+ TALLOC_FREE(fname);
return true;
}
@@ -9117,7 +9118,7 @@ bool lp_load_ex(const char *pszFname,
iServiceIndex = -1;
if (lp_config_backend_is_file()) {
- n2 = alloc_sub_basic(get_current_username(),
+ n2 = talloc_sub_basic(talloc_tos(), get_current_username(),
current_user_info.domain,
pszFname);
if (!n2) {
@@ -9127,7 +9128,7 @@ bool lp_load_ex(const char *pszFname,
add_to_file_list(pszFname, n2);
bRetval = pm_process(n2, do_section, do_parameter, NULL);
- SAFE_FREE(n2);
+ TALLOC_FREE(n2);
/* finish up the last section */
DEBUG(4, ("pm_process() returned %s\n", BOOLSTR(bRetval)));
--
Samba Shared Repository
More information about the samba-cvs
mailing list