summaryrefslogtreecommitdiffstats
path: root/source/lib/talloc.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-04-14 09:44:16 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-04-14 09:44:16 +0000
commit0bdd94cb992b40942aaf2e5e0efd2868b4686296 (patch)
tree2e3ee5a6e8dfe1709faf51b367c191867e67d053 /source/lib/talloc.c
parentd5862891979678c4defb3e33791edca1f1f8c3e4 (diff)
downloadsamba-0bdd94cb992b40942aaf2e5e0efd2868b4686296.tar.gz
samba-0bdd94cb992b40942aaf2e5e0efd2868b4686296.tar.xz
samba-0bdd94cb992b40942aaf2e5e0efd2868b4686296.zip
Partly based on the work by mimir (Rafal Szczesniak
<mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly enumerate its trusted domains - by exaimining the keys in the secrets.tdb file. This patch has been tested with both NT4 and rpcclient/wbinfo, and adds some extra functionality to talloc and rpc_parse to allow it to deal with already unicode strings. Finally, this cleans up some const warnings that were in net_rpc.c by pushing another dash of const into the rpc client code. Andrew Bartlett
Diffstat (limited to 'source/lib/talloc.c')
-rw-r--r--source/lib/talloc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/lib/talloc.c b/source/lib/talloc.c
index 6ac784a9297..b50e451b950 100644
--- a/source/lib/talloc.c
+++ b/source/lib/talloc.c
@@ -287,6 +287,15 @@ char *talloc_strdup(TALLOC_CTX *t, const char *p)
return NULL;
}
+/** strdup_w with a talloc */
+smb_ucs2_t *talloc_strdup_w(TALLOC_CTX *t, const smb_ucs2_t *p)
+{
+ if (p)
+ return talloc_memdup(t, p, (strlen_w(p) + 1) * sizeof(smb_ucs2_t));
+ else
+ return NULL;
+}
+
/**
* Perform string formatting, and return a pointer to newly allocated
* memory holding the result, inside a memory pool.