[SCM] Samba Shared Repository - branch v3-6-test updated

Günther Deschner gd at samba.org
Mon May 16 08:35:19 MDT 2011


The branch, v3-6-test has been updated
       via  fce32d9 s4-smbtorture: add test_netremotetod.
       via  1ace901 s4-libcli/rap: add smbcli_rap_netremotetod().
       via  e4765bf s3-rap: add rap_NetRemoteTOD to IDL.
      from  a68a7df s3-rpc_client: run minimal_includes.pl.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit fce32d92de313862fc9d34fff28d1d10d2f4e5b4
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 11 23:50:23 2011 +0200

    s4-smbtorture: add test_netremotetod.
    
    Guenther
    
    Autobuild-User: Günther Deschner <gd at samba.org>
    Autobuild-Date: Mon May 16 12:45:52 CEST 2011 on sn-devel-104
    (cherry picked from commit 74d82faa78e64bdaed68efb9331a7af1c3016c34)

commit 1ace9011db167b96cb60fef713d69d8d502e9222
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 11 23:37:08 2011 +0200

    s4-libcli/rap: add smbcli_rap_netremotetod().
    
    Guenther
    (cherry picked from commit b1948659ad987ce50d048dabc34f03031a243ee5)

commit e4765bf9f800f565b355d6821459d87658698174
Author: Günther Deschner <gd at samba.org>
Date:   Wed May 11 23:35:21 2011 +0200

    s3-rap: add rap_NetRemoteTOD to IDL.
    
    Guenther
    (cherry picked from commit b82caab5c9d8821cd125654e3233da40eb4c61d1)

-----------------------------------------------------------------------

Summary of changes:
 librpc/idl/rap.idl         |   22 ++++++++++++++++++++
 source4/libcli/rap/rap.c   |   47 ++++++++++++++++++++++++++++++++++++++++++++
 source4/selftest/knownfail |    1 +
 source4/torture/rap/rap.c  |   17 +++++++++++++++
 4 files changed, 87 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/rap.idl b/librpc/idl/rap.idl
index 8087e22..780951c 100644
--- a/librpc/idl/rap.idl
+++ b/librpc/idl/rap.idl
@@ -966,6 +966,28 @@ interface rap
 		[out] uint16 convert
 	);
 
+	typedef [public] struct {
+		uint32 TimeSinceJan11970;
+		uint32 TimeSinceBoot;
+		uint8 Hours;
+		uint8 Minutes;
+		uint8 Seconds;
+		uint8 Hundreds;
+		uint16 TimeZone;
+		uint16 ClockFrequency;
+		uint8 Day;
+		uint8 Month;
+		uint16 Year;
+		uint8 Weekday;
+	} rap_TimeOfDayInfo;
+
+	[public] void rap_NetRemoteTOD(
+		[in] uint16 bufsize,
+		[out] rap_status status,
+		[out] uint16 convert,
+		[out] rap_TimeOfDayInfo tod
+	);
+
 	/* Parameter description strings for RAP calls   */
 	/* Names are defined name for RAP call with _REQ */
 	/* appended to end.                              */
diff --git a/source4/libcli/rap/rap.c b/source4/libcli/rap/rap.c
index 5ea9e81..7743f64 100644
--- a/source4/libcli/rap/rap.c
+++ b/source4/libcli/rap/rap.c
@@ -1633,3 +1633,50 @@ NTSTATUS smbcli_rap_netuserdelete(struct smbcli_tree *tree,
 	talloc_free(call);
 	return result;
 }
+
+NTSTATUS smbcli_rap_netremotetod(struct smbcli_tree *tree,
+				  TALLOC_CTX *mem_ctx,
+				  struct rap_NetRemoteTOD *r)
+{
+	struct rap_call *call;
+	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+	if (!(call = new_rap_cli_call(mem_ctx, RAP_NetRemoteTOD))) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
+	rap_cli_push_rcvbuf(call, r->in.bufsize);
+
+	rap_cli_expect_format(call, "DDBBBBWWBBWB");
+	rap_cli_expect_extra_format(call, "");
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_IN_DEBUG(rap_NetRemoteTOD, r);
+	}
+
+	result = rap_cli_do_call(tree, call);
+
+	if (!NT_STATUS_IS_OK(result))
+		goto done;
+
+	result = NT_STATUS_INVALID_PARAMETER;
+
+	NDR_GOTO(ndr_pull_rap_status(call->ndr_pull_param, NDR_SCALARS, &r->out.status));
+	NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.convert));
+
+	NDR_GOTO(ndr_pull_rap_TimeOfDayInfo(call->ndr_pull_data, NDR_SCALARS|NDR_BUFFERS, &r->out.tod));
+
+	result = NT_STATUS_OK;
+
+	if (!NT_STATUS_IS_OK(result)) {
+		goto done;
+	}
+
+	if (DEBUGLEVEL >= 10) {
+		NDR_PRINT_OUT_DEBUG(rap_NetRemoteTOD, r);
+	}
+
+ done:
+	talloc_free(call);
+	return result;
+}
diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail
index cdd7a2d..d3c3f4e 100644
--- a/source4/selftest/knownfail
+++ b/source4/selftest/knownfail
@@ -41,6 +41,7 @@ samba4.base.charset.*.Testing partial surrogate
 samba4.rap.*netservergetinfo
 samba4.rap.*netsessionenum
 samba4.rap.*netsessiongetinfo
+samba4.rap.*netremotetod
 samba4.smb2.persistent.handles1
 samba4.winbind.struct.*.show_sequence     # Not yet working in winbind
 samba4.winbind.struct.*.getpwent          # Not yet working in winbind
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 5c1c5e1..ee37158 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -206,6 +206,21 @@ static bool test_netsessiongetinfo(struct torture_context *tctx,
 	return true;
 }
 
+static bool test_netremotetod(struct torture_context *tctx,
+			      struct smbcli_state *cli)
+{
+	struct rap_NetRemoteTOD r;
+
+	r.in.bufsize = 8192;
+
+	torture_assert_ntstatus_ok(tctx,
+		smbcli_rap_netremotetod(cli->tree, tctx, &r),
+		"smbcli_rap_netremotetod failed");
+	torture_assert_werr_ok(tctx, W_ERROR(r.out.status),
+		"smbcli_rap_netremotetod failed");
+
+	return true;
+}
 
 bool torture_rap_scan(struct torture_context *torture, struct smbcli_state *cli)
 {
@@ -246,6 +261,8 @@ NTSTATUS torture_rap_init(void)
 				    test_netsessionenum);
 	torture_suite_add_1smb_test(suite_basic, "netsessiongetinfo",
 				    test_netsessiongetinfo);
+	torture_suite_add_1smb_test(suite_basic, "netremotetod",
+				    test_netremotetod);
 
 	torture_suite_add_1smb_test(suite, "scan", torture_rap_scan);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list