summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-03 14:54:06 -0800
committerJeremy Allison <jra@samba.org>2007-12-03 14:54:06 -0800
commitbcf033b38ee2f6c76cd56cae5cd84a6e321ffafa (patch)
tree4e7fdd5f126bc59d62635bf1060d1fd6ca06aeec /source3/passdb
parentdf141905fa389bc4d86bce33d1a763164e120457 (diff)
downloadsamba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.tar.gz
samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.tar.bz2
samba-bcf033b38ee2f6c76cd56cae5cd84a6e321ffafa.zip
Change tdb_unpack "P" to return a malloc'ed string rather
than expect a pstring space to put data into. Fix the (few) callers. Jeremy. (This used to be commit 7722a7d2c63f84b8105aa775b39f0ceedd4ed513)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/secrets.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index c760198b2d..eee8aaed2d 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -484,6 +484,7 @@ static size_t tdb_trusted_dom_pass_unpack(uint8 *pack_buf, int bufsize,
TRUSTED_DOM_PASS* pass)
{
int idx, len = 0;
+ char *passp = NULL;
if (!pack_buf || !pass) return -1;
@@ -495,7 +496,11 @@ static size_t tdb_trusted_dom_pass_unpack(uint8 *pack_buf, int bufsize,
&pass->uni_name[idx]);
len += tdb_unpack(pack_buf + len, bufsize - len, "dPd",
- &pass->pass_len, &pass->pass, &pass->mod_time);
+ &pass->pass_len, &passp, &pass->mod_time);
+ if (passp) {
+ fstrcpy(pass->pass, passp);
+ }
+ SAFE_FREE(passp);
/* unpack domain sid */
len += tdb_sid_unpack(pack_buf + len, bufsize - len,