summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-10-31 11:45:44 (GMT)
committerAndreas Schneider <asn@cryptomilk.org>2019-11-07 14:16:41 (GMT)
commit4736623c24503b3ca09c76c9dbb134ef833b2f80 (patch)
tree3e7c048663f78bc497ad8080fb1e3e2c5eb57e25
parenta591de28659919d2afd7ed55106cded6a0d9ab35 (diff)
downloadsamba-4736623c24503b3ca09c76c9dbb134ef833b2f80.tar.gz
s3: rename talloc_sub_advanced() to talloc_sub_full()
We currently have the following substitution functions: talloc_sub_basic() talloc_sub_advanced() talloc_sub_basic() currently substitutes a subset of talloc_sub_advanced(). We'll need a function X that only substitutes what talloc_sub_advanced() substitutes *without* what talloc_sub_basic() does. To get there rename talloc_sub_advanced() to talloc_sub_full(). A subsequent commit will then bring back talloc_sub_advanced() as described above. Examples with fictional replacement letters A and B. Currently: talloc_sub_basic: A talloc_sub_advanced: AB New: talloc_sub_basic: A talloc_sub_advanced: B talloc_sub_full: AB BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/lib/substitute.c4
-rw-r--r--source3/modules/vfs_expand_msdfs.c2
-rw-r--r--source3/modules/vfs_full_audit.c2
-rw-r--r--source3/modules/vfs_recycle.c2
-rw-r--r--source3/modules/vfs_virusfilter_utils.c2
-rw-r--r--source3/printing/print_generic.c2
-rw-r--r--source3/printing/printing.c8
-rw-r--r--source3/rpc_server/srvsvc/srv_srvsvc_nt.c10
-rw-r--r--source3/smbd/lanman.c4
-rw-r--r--source3/smbd/service.c10
11 files changed, 24 insertions, 24 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 856b412..e453669 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -180,7 +180,7 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
const char *domain,
uid_t uid,
gid_t gid);
-char *talloc_sub_advanced(TALLOC_CTX *mem_ctx,
+char *talloc_sub_full(TALLOC_CTX *mem_ctx,
const char *servicename, const char *user,
const char *connectpath, gid_t gid,
const char *smb_name, const char *domain_name,
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 8fd4fbf..e5cd0f2 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -790,7 +790,7 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
/****************************************************************************
****************************************************************************/
-char *talloc_sub_advanced(TALLOC_CTX *ctx,
+char *talloc_sub_full(TALLOC_CTX *ctx,
const char *servicename,
const char *user,
const char *connectpath,
@@ -804,7 +804,7 @@ char *talloc_sub_advanced(TALLOC_CTX *ctx,
a_string = talloc_strdup(talloc_tos(), str);
if (a_string == NULL) {
- DEBUG(0, ("talloc_sub_advanced: Out of memory!\n"));
+ DBG_ERR("Out of memory!\n");
return NULL;
}
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c
index 0923489..23ea136 100644
--- a/source3/modules/vfs_expand_msdfs.c
+++ b/source3/modules/vfs_expand_msdfs.c
@@ -154,7 +154,7 @@ static char *expand_msdfs_target(TALLOC_CTX *ctx,
return NULL;
}
- targethost = talloc_sub_advanced(ctx,
+ targethost = talloc_sub_full(ctx,
lp_servicename(talloc_tos(), SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 8e46f98..b89996b 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -484,7 +484,7 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
if (!prefix) {
return NULL;
}
- result = talloc_sub_advanced(ctx,
+ result = talloc_sub_full(ctx,
lp_servicename(talloc_tos(), SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c
index b40544a..46a4fcb 100644
--- a/source3/modules/vfs_recycle.c
+++ b/source3/modules/vfs_recycle.c
@@ -467,7 +467,7 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
bool exist;
int rc = -1;
- repository = talloc_sub_advanced(NULL, lp_servicename(talloc_tos(), SNUM(conn)),
+ repository = talloc_sub_full(NULL, lp_servicename(talloc_tos(), SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
conn->session_info->unix_token->gid,
diff --git a/source3/modules/vfs_virusfilter_utils.c b/source3/modules/vfs_virusfilter_utils.c
index 5da87ea..480279f 100644
--- a/source3/modules/vfs_virusfilter_utils.c
+++ b/source3/modules/vfs_virusfilter_utils.c
@@ -35,7 +35,7 @@ char *virusfilter_string_sub(
connection_struct *conn,
const char *str)
{
- return talloc_sub_advanced(mem_ctx,
+ return talloc_sub_full(mem_ctx,
lp_servicename(mem_ctx, SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c
index b6b5006..9c47d3f 100644
--- a/source3/printing/print_generic.c
+++ b/source3/printing/print_generic.c
@@ -72,7 +72,7 @@ static int print_run_command(int snum, const char* printername, bool do_sub,
}
if (do_sub && snum != -1) {
- syscmd = talloc_sub_advanced(ctx,
+ syscmd = talloc_sub_full(ctx,
lp_servicename(talloc_tos(), snum),
current_user_info.unix_name,
"",
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 0ad0704..c6bf6ec 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1724,7 +1724,7 @@ static void print_queue_update(struct messaging_context *msg_ctx,
if (!lpqcommand) {
return;
}
- lpqcommand = talloc_sub_advanced(ctx,
+ lpqcommand = talloc_sub_full(ctx,
lp_servicename(talloc_tos(), snum),
current_user_info.unix_name,
"",
@@ -1744,7 +1744,7 @@ static void print_queue_update(struct messaging_context *msg_ctx,
if (!lprmcommand) {
return;
}
- lprmcommand = talloc_sub_advanced(ctx,
+ lprmcommand = talloc_sub_full(ctx,
lp_servicename(talloc_tos(), snum),
current_user_info.unix_name,
"",
@@ -2866,7 +2866,7 @@ WERROR print_job_start(const struct auth_session_info *server_info,
fstrcpy(pjob.clientmachine, clientmachine);
- userstr = talloc_sub_advanced(talloc_tos(),
+ userstr = talloc_sub_full(talloc_tos(),
sharename,
server_info->unix_info->sanitized_username,
path, server_info->unix_token->gid,
@@ -3035,7 +3035,7 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
status = NT_STATUS_PRINT_CANCELLED;
goto fail;
}
- lpq_cmd = talloc_sub_advanced(tmp_ctx,
+ lpq_cmd = talloc_sub_full(tmp_ctx,
lp_servicename(talloc_tos(), snum),
current_user_info.unix_name,
"",
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index d4de3cd..34a227c 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -225,7 +225,7 @@ static void init_srv_share_info_1(struct pipes_struct *p,
char *remark = lp_comment(p->mem_ctx, snum);
if (remark) {
- remark = talloc_sub_advanced(
+ remark = talloc_sub_full(
p->mem_ctx, lp_servicename(talloc_tos(), snum),
get_current_username(), lp_path(talloc_tos(), snum),
p->session_info->unix_token->uid, get_current_username(),
@@ -253,7 +253,7 @@ static void init_srv_share_info_2(struct pipes_struct *p,
remark = lp_comment(p->mem_ctx, snum);
if (remark) {
- remark = talloc_sub_advanced(
+ remark = talloc_sub_full(
p->mem_ctx, lp_servicename(talloc_tos(), snum),
get_current_username(), lp_path(talloc_tos(), snum),
p->session_info->unix_token->uid, get_current_username(),
@@ -318,7 +318,7 @@ static void init_srv_share_info_501(struct pipes_struct *p,
char *remark = lp_comment(p->mem_ctx, snum);
if (remark) {
- remark = talloc_sub_advanced(
+ remark = talloc_sub_full(
p->mem_ctx, lp_servicename(talloc_tos(), snum),
get_current_username(), lp_path(talloc_tos(), snum),
p->session_info->unix_token->uid, get_current_username(),
@@ -352,7 +352,7 @@ static void init_srv_share_info_502(struct pipes_struct *p,
char *remark = lp_comment(ctx, snum);
if (remark) {
- remark = talloc_sub_advanced(
+ remark = talloc_sub_full(
p->mem_ctx, lp_servicename(talloc_tos(), snum),
get_current_username(), lp_path(talloc_tos(), snum),
p->session_info->unix_token->uid, get_current_username(),
@@ -393,7 +393,7 @@ static void init_srv_share_info_1004(struct pipes_struct *p,
char *remark = lp_comment(p->mem_ctx, snum);
if (remark) {
- remark = talloc_sub_advanced(
+ remark = talloc_sub_full(
p->mem_ctx, lp_servicename(talloc_tos(), snum),
get_current_username(), lp_path(talloc_tos(), snum),
p->session_info->unix_token->uid, get_current_username(),
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 50451b2..ee6e9a4 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -115,7 +115,7 @@ static int CopyExpanded(connection_struct *conn,
*p_space_remaining = 0;
return 0;
}
- buf = talloc_sub_advanced(ctx,
+ buf = talloc_sub_full(ctx,
lp_servicename(ctx, SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
@@ -166,7 +166,7 @@ static int StrlenExpanded(connection_struct *conn, int snum, char *s)
if (!buf) {
return 0;
}
- buf = talloc_sub_advanced(ctx,
+ buf = talloc_sub_full(ctx,
lp_servicename(ctx, SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 7e252a4..1a708fc 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -611,7 +611,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
conn->vuid = vuser->vuid;
{
- char *s = talloc_sub_advanced(talloc_tos(),
+ char *s = talloc_sub_full(talloc_tos(),
lp_const_servicename(SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
@@ -727,7 +727,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
* to below */
/* execute any "root preexec = " line */
if (*lp_root_preexec(talloc_tos(), snum)) {
- char *cmd = talloc_sub_advanced(talloc_tos(),
+ char *cmd = talloc_sub_full(talloc_tos(),
lp_const_servicename(SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
@@ -765,7 +765,7 @@ static NTSTATUS make_connection_snum(struct smbXsrv_connection *xconn,
/* execute any "preexec = " line */
if (*lp_preexec(talloc_tos(), snum)) {
- char *cmd = talloc_sub_advanced(talloc_tos(),
+ char *cmd = talloc_sub_full(talloc_tos(),
lp_const_servicename(SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
@@ -1163,7 +1163,7 @@ void close_cnum(connection_struct *conn, uint64_t vuid)
/* execute any "postexec = " line */
if (*lp_postexec(talloc_tos(), SNUM(conn)) &&
change_to_user_and_service(conn, vuid)) {
- char *cmd = talloc_sub_advanced(talloc_tos(),
+ char *cmd = talloc_sub_full(talloc_tos(),
lp_const_servicename(SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,
@@ -1179,7 +1179,7 @@ void close_cnum(connection_struct *conn, uint64_t vuid)
change_to_root_user();
/* execute any "root postexec = " line */
if (*lp_root_postexec(talloc_tos(), SNUM(conn))) {
- char *cmd = talloc_sub_advanced(talloc_tos(),
+ char *cmd = talloc_sub_full(talloc_tos(),
lp_const_servicename(SNUM(conn)),
conn->session_info->unix_info->unix_name,
conn->connectpath,