summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-11-24 15:47:04 +0100
committerVolker Lendecke <vl@sernet.de>2007-12-05 14:39:07 +0100
commit195d6be38d9d721837a8d44ff918829528059cda (patch)
tree5a7fb32b88a656927e2e2a4b699d135b22e77612 /source3/torture
parent78c6ee0090f4122bc25baaacb5546517ad4b7bc6 (diff)
downloadsamba-195d6be38d9d721837a8d44ff918829528059cda.tar.gz
samba-195d6be38d9d721837a8d44ff918829528059cda.tar.bz2
samba-195d6be38d9d721837a8d44ff918829528059cda.zip
remove some statics
(This used to be commit 97c9a4042d36178a728b5e0f8923091c7069366d)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/rpctorture.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source3/torture/rpctorture.c b/source3/torture/rpctorture.c
index d399ae8a0f..8db58014b7 100644
--- a/source3/torture/rpctorture.c
+++ b/source3/torture/rpctorture.c
@@ -45,6 +45,40 @@ void rpcclient_init(void)
smb_cli->capabilities |= CAP_NT_SMBS;
}
+/*******************************************************************
+ Convert, possibly using a stupid microsoft-ism which has destroyed
+ the transport independence of netbios (for CIFS vendors that usually
+ use the Win95-type methods, not for NT to NT communication, which uses
+ DCE/RPC and therefore full-length unicode strings...) a dns name into
+ a netbios name.
+
+ The netbios name (NOT necessarily null-terminated) is truncated to 15
+ characters.
+
+ ******************************************************************/
+
+static char *dns_to_netbios_name(const char *dns_name)
+{
+ static nstring netbios_name;
+ int i;
+ StrnCpy(netbios_name, dns_name, MAX_NETBIOSNAME_LEN-1);
+ netbios_name[15] = 0;
+
+ /* ok. this is because of a stupid microsoft-ism. if the called host
+ name contains a '.', microsoft clients expect you to truncate the
+ netbios name up to and including the '.' this even applies, by
+ mistake, to workgroup (domain) names, which is _really_ daft.
+ */
+ for (i = 0; i < 15; i++) {
+ if (netbios_name[i] == '.') {
+ netbios_name[i] = 0;
+ break;
+ }
+ }
+
+ return netbios_name;
+}
+
/****************************************************************************
make smb client connection
****************************************************************************/