summaryrefslogtreecommitdiff
path: root/source4/ntptr/simple_ldb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-01 12:19:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:03 -0500
commitccaf752e357833b8acc49b471d78b56ae90c8d0f (patch)
treea8934e765a069a548a846714dad0610b3a7f0674 /source4/ntptr/simple_ldb
parent4354bebda7273169304ad41fea1aa5cadfa322cf (diff)
downloadsamba-ccaf752e357833b8acc49b471d78b56ae90c8d0f.tar.gz
samba-ccaf752e357833b8acc49b471d78b56ae90c8d0f.tar.bz2
samba-ccaf752e357833b8acc49b471d78b56ae90c8d0f.zip
r8054: add OSVersion, OSVersionEx, DNSMachineName PrintServerData
metze (This used to be commit 47781fccbc9a4fc3867e4c3959a17765c7e4dc71)
Diffstat (limited to 'source4/ntptr/simple_ldb')
-rw-r--r--source4/ntptr/simple_ldb/ntptr_simple_ldb.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
index c83cac4440..27c13346b0 100644
--- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
+++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
@@ -160,6 +160,53 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
r->out.type = SPOOLSS_PRINTER_DATA_TYPE_UINT32;
r->out.data.value = 1;
return WERR_OK;
+ } else if (strcmp("OSVersion", r->in.value_name) == 0) {
+ DATA_BLOB blob;
+ NTSTATUS status;
+ struct spoolss_OSVersion os;
+
+ os.major = dcesrv_common_get_version_major(mem_ctx, NULL);
+ os.minor = dcesrv_common_get_version_minor(mem_ctx, NULL);
+ os.build = dcesrv_common_get_version_build(mem_ctx, NULL);
+ os.extra_string = "";
+
+ status = ndr_push_struct_blob(&blob, mem_ctx, &os, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersion);
+ if (!NT_STATUS_IS_OK(status)) {
+ return WERR_GENERAL_FAILURE;
+ }
+
+ r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
+ r->out.data.binary = blob;
+ return WERR_OK;
+ } else if (strcmp("OSVersionEx", r->in.value_name) == 0) {
+ DATA_BLOB blob;
+ NTSTATUS status;
+ struct spoolss_OSVersionEx os_ex;
+
+ os_ex.major = dcesrv_common_get_version_major(mem_ctx, NULL);
+ os_ex.minor = dcesrv_common_get_version_minor(mem_ctx, NULL);
+ os_ex.build = dcesrv_common_get_version_build(mem_ctx, NULL);
+ os_ex.extra_string = "";
+ os_ex.unknown2 = 0;
+ os_ex.unknown3 = 0;
+
+ status = ndr_push_struct_blob(&blob, mem_ctx, &os_ex, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersionEx);
+ if (!NT_STATUS_IS_OK(status)) {
+ return WERR_GENERAL_FAILURE;
+ }
+
+ r->out.type = SPOOLSS_PRINTER_DATA_TYPE_BINARY;
+ r->out.data.binary = blob;
+ return WERR_OK;
+ } else if (strcmp("DNSMachineName", r->in.value_name) == 0) {
+ if (!lp_realm()) return WERR_INVALID_PARAM;
+
+ r->out.type = SPOOLSS_PRINTER_DATA_TYPE_STRING;
+ r->out.data.string = talloc_asprintf(mem_ctx, "%s.%s",
+ lp_netbios_name(),
+ lp_realm());
+ W_ERROR_HAVE_NO_MEMORY(r->out.data.string);
+ return WERR_OK;
}
return WERR_INVALID_PARAM;