diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-04-14 09:44:16 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-04-14 09:44:16 +0000 |
commit | 07e6ff5fcfe337bb65a7c3a4493a92a7761cf2ed (patch) | |
tree | 0623e2c8e4b760f294c31de6f01aec1ec1a71902 /source3/lib/talloc.c | |
parent | 06f15779303dc540ee7801fe843023970454166b (diff) | |
download | samba-07e6ff5fcfe337bb65a7c3a4493a92a7761cf2ed.tar.gz samba-07e6ff5fcfe337bb65a7c3a4493a92a7761cf2ed.tar.bz2 samba-07e6ff5fcfe337bb65a7c3a4493a92a7761cf2ed.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
(This used to be commit 0bdd94cb992b40942aaf2e5e0efd2868b4686296)
Diffstat (limited to 'source3/lib/talloc.c')
-rw-r--r-- | source3/lib/talloc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c index 6ac784a929..b50e451b95 100644 --- a/source3/lib/talloc.c +++ b/source3/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. |