mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
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> (backported from commit 4736623c24503b3ca09c76c9dbb134ef833b2f80)
This commit is contained in:
parent
eb30462529
commit
3a9fa54ca0
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -485,7 +485,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,
|
||||
|
@ -460,7 +460,7 @@ static int recycle_unlink(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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
"",
|
||||
|
@ -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,
|
||||
"",
|
||||
|
@ -226,7 +226,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(),
|
||||
@ -254,7 +254,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(),
|
||||
@ -319,7 +319,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(),
|
||||
@ -353,7 +353,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(),
|
||||
@ -394,7 +394,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(),
|
||||
|
@ -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,
|
||||
|
@ -583,7 +583,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,
|
||||
@ -699,7 +699,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,
|
||||
@ -737,7 +737,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,
|
||||
@ -1139,7 +1139,7 @@ void close_cnum(connection_struct *conn, uint64_t vuid)
|
||||
/* execute any "postexec = " line */
|
||||
if (*lp_postexec(talloc_tos(), SNUM(conn)) &&
|
||||
change_to_user(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,
|
||||
@ -1155,7 +1155,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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user