svn commit: samba r15939 - in branches/SAMBA_4_0/source/torture/libnet: .

mimir at samba.org mimir at samba.org
Mon May 29 21:59:55 GMT 2006


Author: mimir
Date: 2006-05-29 21:59:55 +0000 (Mon, 29 May 2006)
New Revision: 15939

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15939

Log:
Add tests for userinfo call with username argument provided
which enables optional stage resolving username to a rid.


rafal


Modified:
   branches/SAMBA_4_0/source/torture/libnet/userinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/libnet/userinfo.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/userinfo.c	2006-05-29 21:58:53 UTC (rev 15938)
+++ branches/SAMBA_4_0/source/torture/libnet/userinfo.c	2006-05-29 21:59:55 UTC (rev 15939)
@@ -184,6 +184,7 @@
 			  struct dom_sid2 *domain_sid, const char* user_name,
 			  uint32_t *rid)
 {
+	const uint16_t level = 5;
 	NTSTATUS status;
 	struct libnet_rpc_userinfo user;
 	struct dom_sid *user_sid;
@@ -192,15 +193,29 @@
 	
 	user.in.domain_handle = *domain_handle;
 	user.in.sid           = dom_sid_string(mem_ctx, user_sid);
-	user.in.level         = 5;       /* this should be extended */
+	user.in.level         = level;       /* this should be extended */
 
-	printf("Testing sync libnet_rpc_userinfo\n");
+	printf("Testing sync libnet_rpc_userinfo (SID argument)\n");
 	status = libnet_rpc_userinfo(p, mem_ctx, &user);
 	if (!NT_STATUS_IS_OK(status)) {
 		printf("Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status));
 		return False;
 	}
 
+	ZERO_STRUCT(user);
+
+	user.in.domain_handle = *domain_handle;
+	user.in.sid           = NULL;
+	user.in.username      = TEST_USERNAME;
+	user.in.level         = level;
+
+	printf("Testing sync libnet_rpc_userinfo (username argument)\n");
+	status = libnet_rpc_userinfo(p, mem_ctx, &user);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status));
+		return False;
+	}
+
 	return True;
 }
 
@@ -234,6 +249,7 @@
 				struct dom_sid2 *domain_sid, const char* user_name,
 				uint32_t *rid)
 {
+	const uint16_t level = 10;
 	NTSTATUS status;
 	struct composite_context *c;
 	struct libnet_rpc_userinfo user;
@@ -243,9 +259,9 @@
 
 	user.in.domain_handle = *domain_handle;
 	user.in.sid           = dom_sid_string(mem_ctx, user_sid);
-	user.in.level         = 10;       /* this should be extended */
+	user.in.level         = level;       /* this should be extended */
 
-	printf("Testing async libnet_rpc_userinfo\n");
+	printf("Testing async libnet_rpc_userinfo (SID argument)\n");
 
 	c = libnet_rpc_userinfo_send(p, &user, msg_handler);
 	if (!c) {
@@ -259,6 +275,27 @@
 		return False;
 	}
 
+	ZERO_STRUCT(user);
+
+	user.in.domain_handle = *domain_handle;
+	user.in.sid           = NULL;
+	user.in.username      = TEST_USERNAME;
+	user.in.level         = level;
+
+	printf("Testing async libnet_rpc_userinfo (username argument)\n");
+
+	c = libnet_rpc_userinfo_send(p, &user, msg_handler);
+	if (!c) {
+		printf("Failed to call sync libnet_rpc_userinfo_send\n");
+		return False;
+	}
+
+	status = libnet_rpc_userinfo_recv(c, mem_ctx, &user);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("Calling async libnet_rpc_userinfo failed - %s\n", nt_errstr(status));
+		return False;
+	}
+
 	return True;
 }
 



More information about the samba-cvs mailing list