summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-11-21 12:46:02 +0100
committerStefan Metzmacher <metze@samba.org>2017-01-12 15:35:13 +0100
commitb9199945e7c28f8e5603727896c2af295376dc5b (patch)
treec82a9c2190ed1a68c40093625c19ef1231bb2dc1 /source3/rpc_server
parent92fc6a6c254703b771dec0b56b598c2684b4278a (diff)
downloadsamba-b9199945e7c28f8e5603727896c2af295376dc5b.tar.gz
s3-spoolss: globally set print server environment/architecture.
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 669ba2485a0..80d30cffbbf 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -80,6 +80,7 @@
#define GLOBAL_SPOOLSS_OS_MAJOR_DEFAULT 5
#define GLOBAL_SPOOLSS_OS_MINOR_DEFAULT 2
#define GLOBAL_SPOOLSS_OS_BUILD_DEFAULT 3790
+#define GLOBAL_SPOOLSS_ARCHITECTURE SPOOLSS_ARCHITECTURE_x64
static struct printer_handle *printers_list;
@@ -2354,7 +2355,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
if (!strcasecmp_m(value, "Architecture")) {
*type = REG_SZ;
data->string = talloc_strdup(mem_ctx,
- lp_parm_const_string(GLOBAL_SECTION_SNUM, "spoolss", "architecture", SPOOLSS_ARCHITECTURE_x64));
+ lp_parm_const_string(GLOBAL_SECTION_SNUM, "spoolss", "architecture", GLOBAL_SPOOLSS_ARCHITECTURE));
W_ERROR_HAVE_NO_MEMORY(data->string);
return WERR_OK;
@@ -3837,6 +3838,8 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx,
print_status_struct status;
WERROR result;
int os_major, os_minor, os_build;
+ const char *architecture;
+ uint32_t processor_architecture, processor_type;
result = create_printername(mem_ctx, servername, info2->printername, &r->printername);
if (!W_ERROR_IS_OK(result)) {
@@ -3899,6 +3902,19 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx,
SCVAL(&r->version, 1, os_minor);
SSVAL(&r->version, 2, os_build);
+ architecture = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "spoolss",
+ "architecture",
+ GLOBAL_SPOOLSS_ARCHITECTURE);
+
+ if (strequal(architecture, SPOOLSS_ARCHITECTURE_x64)) {
+ processor_architecture = PROCESSOR_ARCHITECTURE_AMD64;
+ processor_type = PROCESSOR_AMD_X8664;
+ } else {
+ processor_architecture = PROCESSOR_ARCHITECTURE_INTEL;
+ processor_type = PROCESSOR_INTEL_PENTIUM;
+ }
+
r->free_build = SPOOLSS_RELEASE_BUILD;
r->spooling = 0;
r->max_spooling = 0;
@@ -3907,7 +3923,7 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx,
r->num_error_not_ready = 0x0; /* number of print failure */
r->job_error = 0x0;
r->number_of_processors = 0x1;
- r->processor_type = PROCESSOR_AMD_X8664;
+ r->processor_type = processor_type;
r->high_part_total_bytes = 0x0;
/* ChangeID in milliseconds*/
@@ -3918,7 +3934,7 @@ static WERROR construct_printer_info0(TALLOC_CTX *mem_ctx,
r->status = nt_printq_status(status.status);
r->enumerate_network_printers = 0x0;
r->c_setprinter = 0x0;
- r->processor_architecture = PROCESSOR_ARCHITECTURE_AMD64;
+ r->processor_architecture = processor_architecture;
r->processor_level = 0x6; /* 6 ???*/
r->ref_ic = 0;
r->reserved2 = 0;
@@ -8662,7 +8678,7 @@ static WERROR compose_spoolss_server_path(TALLOC_CTX *mem_ctx,
} else {
long_archi = lp_parm_const_string(GLOBAL_SECTION_SNUM,
"spoolss", "architecture",
- SPOOLSS_ARCHITECTURE_x64);
+ GLOBAL_SPOOLSS_ARCHITECTURE);
}
/* servername may be empty */
@@ -9502,7 +9518,7 @@ static WERROR enumprintmonitors_level_2(TALLOC_CTX *mem_ctx,
architecture = lp_parm_const_string(GLOBAL_SECTION_SNUM,
"spoolss",
"architecture",
- SPOOLSS_ARCHITECTURE_x64);
+ GLOBAL_SPOOLSS_ARCHITECTURE);
result = fill_monitor_2(info, &info[0].info2,
SPL_LOCAL_PORT,