mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
smbdotconf: mark "server string" with substitution="1"
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
8077804c36
commit
7dc7b9e554
@ -1,6 +1,7 @@
|
||||
<samba:parameter name="server string"
|
||||
context="G"
|
||||
type="string"
|
||||
substitution="1"
|
||||
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
|
||||
<description>
|
||||
<para>This controls what string will show up in the printer comment box in print
|
||||
|
@ -34,6 +34,8 @@
|
||||
static WERROR NetServerGetInfo_l_101(struct libnetapi_ctx *ctx,
|
||||
uint8_t **buffer)
|
||||
{
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
loadparm_s3_global_substitution();
|
||||
struct SERVER_INFO_101 i;
|
||||
|
||||
i.sv101_platform_id = PLATFORM_ID_NT;
|
||||
@ -41,7 +43,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_server_string(ctx);
|
||||
i.sv101_comment = lp_server_string(ctx, lp_sub);
|
||||
|
||||
*buffer = (uint8_t *)talloc_memdup(ctx, &i, sizeof(i));
|
||||
if (!*buffer) {
|
||||
@ -57,9 +59,11 @@ static WERROR NetServerGetInfo_l_101(struct libnetapi_ctx *ctx,
|
||||
static WERROR NetServerGetInfo_l_1005(struct libnetapi_ctx *ctx,
|
||||
uint8_t **buffer)
|
||||
{
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
loadparm_s3_global_substitution();
|
||||
struct SERVER_INFO_1005 info1005;
|
||||
|
||||
info1005.sv1005_comment = lp_server_string(ctx);
|
||||
info1005.sv1005_comment = lp_server_string(ctx, lp_sub);
|
||||
*buffer = (uint8_t *)talloc_memdup(ctx, &info1005, sizeof(info1005));
|
||||
if (!*buffer) {
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
|
@ -481,7 +481,7 @@ void announce_remote(time_t t)
|
||||
if (!*s)
|
||||
return;
|
||||
|
||||
comment = string_truncate(lp_server_string(talloc_tos()),
|
||||
comment = string_truncate(lp_server_string(talloc_tos(), lp_sub),
|
||||
MAX_SERVER_STRING_LENGTH);
|
||||
|
||||
frame = talloc_stackframe();
|
||||
|
@ -275,6 +275,8 @@ void write_browse_list(time_t t, bool force_write)
|
||||
bool list_changed = force_write;
|
||||
static time_t lasttime = 0;
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
loadparm_s3_global_substitution();
|
||||
|
||||
/* Always dump if we're being told to by a signal. */
|
||||
if(force_write == False) {
|
||||
@ -369,7 +371,7 @@ void write_browse_list(time_t t, bool force_write)
|
||||
|
||||
/* Output server details, plus what workgroup they're in. */
|
||||
write_browse_list_entry(fp, my_netbios_names(i), stype,
|
||||
string_truncate(lp_server_string(talloc_tos()), MAX_SERVER_STRING_LENGTH), lp_workgroup());
|
||||
string_truncate(lp_server_string(talloc_tos(), lp_sub), MAX_SERVER_STRING_LENGTH), lp_workgroup());
|
||||
}
|
||||
|
||||
for (subrec = FIRST_SUBNET; subrec ; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) {
|
||||
|
@ -226,6 +226,8 @@ static void fail_register(struct subnet_record *subrec, struct response_record *
|
||||
|
||||
void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work)
|
||||
{
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
loadparm_s3_global_substitution();
|
||||
int i;
|
||||
|
||||
if(!strequal(lp_workgroup(), work->work_group))
|
||||
@ -254,7 +256,7 @@ workgroup %s on subnet %s\n", work->work_group, subrec->subnet_name));
|
||||
stype &= ~(SV_TYPE_MASTER_BROWSER|SV_TYPE_POTENTIAL_BROWSER|SV_TYPE_DOMAIN_MASTER|SV_TYPE_DOMAIN_MEMBER);
|
||||
|
||||
create_server_on_workgroup(work,name,stype|SV_TYPE_LOCAL_LIST_ONLY, PERMANENT_TTL,
|
||||
string_truncate(lp_server_string(talloc_tos()), MAX_SERVER_STRING_LENGTH));
|
||||
string_truncate(lp_server_string(talloc_tos(), lp_sub), MAX_SERVER_STRING_LENGTH));
|
||||
DEBUG(3,("initiate_myworkgroup_startup: Added server name entry %s \
|
||||
on subnet %s\n", name, subrec->subnet_name));
|
||||
}
|
||||
|
@ -3266,6 +3266,8 @@ static NTSTATUS query_dom_info_2(TALLOC_CTX *mem_ctx,
|
||||
struct samr_DomGeneralInformation *r,
|
||||
struct samr_domain_info *dinfo)
|
||||
{
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
loadparm_s3_global_substitution();
|
||||
uint32_t u_logout;
|
||||
time_t seq_num;
|
||||
|
||||
@ -3289,7 +3291,7 @@ static NTSTATUS query_dom_info_2(TALLOC_CTX *mem_ctx,
|
||||
|
||||
unbecome_root();
|
||||
|
||||
r->oem_information.string = lp_server_string(r);
|
||||
r->oem_information.string = lp_server_string(r, lp_sub);
|
||||
r->domain_name.string = lp_workgroup();
|
||||
r->primary.string = lp_netbios_name();
|
||||
r->sequence_num = seq_num;
|
||||
@ -3333,7 +3335,10 @@ static NTSTATUS query_dom_info_3(TALLOC_CTX *mem_ctx,
|
||||
static NTSTATUS query_dom_info_4(TALLOC_CTX *mem_ctx,
|
||||
struct samr_DomOEMInformation *r)
|
||||
{
|
||||
r->oem_information.string = lp_server_string(r);
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
loadparm_s3_global_substitution();
|
||||
|
||||
r->oem_information.string = lp_server_string(r, lp_sub);
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
@ -1324,6 +1324,8 @@ WERROR _srvsvc_NetFileEnum(struct pipes_struct *p,
|
||||
WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
|
||||
struct srvsvc_NetSrvGetInfo *r)
|
||||
{
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
loadparm_s3_global_substitution();
|
||||
WERROR status = WERR_OK;
|
||||
|
||||
DEBUG(5,("_srvsvc_NetSrvGetInfo: %d\n", __LINE__));
|
||||
@ -1352,7 +1354,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
|
||||
info102->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
|
||||
info102->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
|
||||
info102->server_type = lp_default_server_announce();
|
||||
info102->comment = string_truncate(lp_server_string(talloc_tos()),
|
||||
info102->comment = string_truncate(lp_server_string(talloc_tos(), lp_sub),
|
||||
MAX_SERVER_STRING_LENGTH);
|
||||
info102->users = 0xffffffff;
|
||||
info102->disc = 0xf;
|
||||
@ -1378,7 +1380,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
|
||||
info101->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
|
||||
info101->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
|
||||
info101->server_type = lp_default_server_announce();
|
||||
info101->comment = string_truncate(lp_server_string(talloc_tos()),
|
||||
info101->comment = string_truncate(lp_server_string(talloc_tos(), lp_sub),
|
||||
MAX_SERVER_STRING_LENGTH);
|
||||
|
||||
r->out.info->info101 = info101;
|
||||
|
@ -1437,6 +1437,8 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
|
||||
{
|
||||
struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
|
||||
struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);
|
||||
const struct loadparm_substitution *lp_sub =
|
||||
lpcfg_noop_substitution();
|
||||
|
||||
ZERO_STRUCTP(r->out.info);
|
||||
|
||||
@ -1469,7 +1471,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
|
||||
info101->version_major = server_info->version_major;
|
||||
info101->version_minor = server_info->version_minor;
|
||||
info101->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx);
|
||||
info101->comment = lpcfg_server_string(dce_ctx->lp_ctx, mem_ctx);
|
||||
info101->comment = lpcfg_server_string(dce_ctx->lp_ctx, lp_sub, mem_ctx);
|
||||
W_ERROR_HAVE_NO_MEMORY(info101->comment);
|
||||
|
||||
r->out.info->info101 = info101;
|
||||
@ -1489,7 +1491,7 @@ static WERROR dcesrv_srvsvc_NetSrvGetInfo(struct dcesrv_call_state *dce_call, TA
|
||||
info102->version_major = server_info->version_major;
|
||||
info102->version_minor = server_info->version_minor;
|
||||
info102->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx);
|
||||
info102->comment = lpcfg_server_string(dce_ctx->lp_ctx, mem_ctx);
|
||||
info102->comment = lpcfg_server_string(dce_ctx->lp_ctx, lp_sub, mem_ctx);
|
||||
W_ERROR_HAVE_NO_MEMORY(info102->comment);
|
||||
|
||||
info102->users = dcesrv_common_get_users(mem_ctx, dce_ctx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user