summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/librpc/idl/spoolss.idl3
-rw-r--r--source4/torture/rpc/spoolss.c39
2 files changed, 40 insertions, 2 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl
index 85c49566b0..7f52c6442e 100644
--- a/source4/librpc/idl/spoolss.idl
+++ b/source4/librpc/idl/spoolss.idl
@@ -712,6 +712,9 @@
/******************/
/* Function: 0x25 */
WERROR spoolss_AddPort(
+ [in] unistr *server_name,
+ [in] uint32 unknown,
+ [in] unistr monitor_name
);
/******************/
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 7ca8db5a10..94ced04a98 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -303,7 +303,7 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
- printf("EnumPorts failed -- %s\n", nt_errstr(status));
+ printf("EnumPorts failed - %s\n", nt_errstr(status));
return False;
}
@@ -316,7 +316,7 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
status = dcerpc_spoolss_EnumPorts(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
- printf("EnumPorts failed -- %s\n", nt_errstr(status));
+ printf("EnumPorts failed - %s\n", nt_errstr(status));
return False;
}
@@ -329,6 +329,39 @@ static BOOL test_EnumPorts(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return True;
}
+static BOOL test_AddPort(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct spoolss_AddPort r;
+
+ r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s",
+ dcerpc_server_name(p));
+ r.in.unknown = 0;
+ r.in.monitor_name = "foo";
+
+ printf ("Testing AddPort\n");
+
+ status = dcerpc_spoolss_AddPort(p, mem_ctx, &r);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("AddPort failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ /* win2k3 returns WERR_NOT_SUPPORTED */
+
+#if 0
+
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("AddPort failed - %s\n", win_errstr(r.out.result));
+ return False;
+ }
+
+#endif
+
+ return True;
+}
+
static BOOL test_GetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle, uint32_t job_id)
{
@@ -1095,6 +1128,8 @@ BOOL torture_rpc_spoolss(void)
ret &= test_OpenPrinter_badnames(p, mem_ctx);
+ ret &= test_AddPort(p, mem_ctx);
+
ret &= test_EnumPorts(p, mem_ctx);
ret &= test_EnumPrinters(p, mem_ctx);