summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-06-06 12:59:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:34 -0500
commit42eadaf3d94afc7abf8ba2f1a67c55f317215483 (patch)
tree17aba1b55e533eece7b1b6a529ac309000549a3f /source4/lib
parent7b1e0454ef1a6af65c9e9305b7502ca5294a1793 (diff)
downloadsamba-42eadaf3d94afc7abf8ba2f1a67c55f317215483.tar.gz
samba-42eadaf3d94afc7abf8ba2f1a67c55f317215483.tar.bz2
samba-42eadaf3d94afc7abf8ba2f1a67c55f317215483.zip
r1048: - moved the schannel definitions into a separate schannel.idl
- added server side support for schannel type 23. This allows WinXP to establish a schannel connection to Samba4 as an ADS DC - added client side support for schannel type 23, but disabled it as currently the client code has now way of getting the fully qualified domain name (which is needed) - report dcerpc faults in the server code in the log (This used to be commit 55e0b014fe14ca8811b55887208a1c3147ddb0d2)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/util_str.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c
index 7b1a81bdfd..bb94d3fce6 100644
--- a/source4/lib/util_str.c
+++ b/source4/lib/util_str.c
@@ -1396,3 +1396,37 @@ size_t valgrind_strlen(const char *s)
return count;
}
#endif
+
+
+/*
+ format a string into length-prefixed dotted domain format, as used in NBT
+ and in some ADS structures
+*/
+const char *str_format_nbt_domain(TALLOC_CTX *mem_ctx, const char *s)
+{
+ char *ret;
+ int i;
+ if (!s || !*s) {
+ return talloc_strdup(mem_ctx, "");
+ }
+ ret = talloc(mem_ctx, strlen(s)+2);
+ if (!ret) {
+ return ret;
+ }
+
+ memcpy(ret+1, s, strlen(s)+1);
+ ret[0] = '.';
+
+ for (i=0;ret[i];i++) {
+ if (ret[i] == '.') {
+ char *p = strchr(ret+i+1, '.');
+ if (p) {
+ ret[i] = p-(ret+i+1);
+ } else {
+ ret[i] = strlen(ret+i+1);
+ }
+ }
+ }
+
+ return ret;
+}