svn commit: samba r1685 - in branches/SAMBA_4_0/source: libcli/auth torture/rpc

abartlet at samba.org abartlet at samba.org
Tue Aug 10 04:28:00 GMT 2004


Author: abartlet
Date: 2004-08-10 04:28:00 +0000 (Tue, 10 Aug 2004)
New Revision: 1685
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=1685&nolog=1
Log:
Add the ability to lookup RPC auth types for the RPC-MGMT torture test.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/libcli/auth/gensec.c
   branches/SAMBA_4_0/source/torture/rpc/mgmt.c

Changeset:
Modified: branches/SAMBA_4_0/source/libcli/auth/gensec.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/gensec.c	2004-08-10 02:05:38 UTC (rev 1684)
+++ branches/SAMBA_4_0/source/libcli/auth/gensec.c	2004-08-10 04:28:00 UTC (rev 1685)
@@ -212,6 +212,17 @@
 	return gensec_start_mech(gensec_security);
 }
 
+const char *gensec_get_name_by_authtype(uint8_t authtype) 
+{
+	const struct gensec_security_ops *ops;
+	ops = gensec_security_by_authtype(authtype);
+	if (ops) {
+		return ops->name;
+	}
+	return NULL;
+}
+	
+
 /** 
  * Start a GENSEC sub-mechanism by OID, used in SPNEGO
  *

Modified: branches/SAMBA_4_0/source/torture/rpc/mgmt.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/mgmt.c	2004-08-10 02:05:38 UTC (rev 1684)
+++ branches/SAMBA_4_0/source/torture/rpc/mgmt.c	2004-08-10 04:28:00 UTC (rev 1685)
@@ -109,9 +109,15 @@
 			continue;
 		}
 		if (W_ERROR_IS_OK(r.out.result)) {
+			const char *name = gensec_get_name_by_authtype(i);
 			ret = True;
-			printf("\tprinciple name for proto %u is '%s'\n", 
-			       i, r.out.princ_name);
+			if (name) {
+				printf("\tprinciple name for proto %u (%s) is '%s'\n", 
+				       i, name, r.out.princ_name);
+			} else {
+				printf("\tprinciple name for proto %u is '%s'\n", 
+				       i, r.out.princ_name);
+			}
 		}
 	}
 



More information about the samba-cvs mailing list