summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/samba3sam.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-01-02 03:40:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:35:51 -0500
commitadcc7299b698b9942cd1fe1cbf9080d0bd952dbf (patch)
treeb6d56edcecb0b7d843cdb90c6485b7d5cd3b7eb2 /source4/dsdb/samdb/ldb_modules/samba3sam.c
parent0311a5396b1740c3a0f0cdde7a2e5da4be50d4bd (diff)
downloadsamba-adcc7299b698b9942cd1fe1cbf9080d0bd952dbf.tar.gz
samba-adcc7299b698b9942cd1fe1cbf9080d0bd952dbf.tar.bz2
samba-adcc7299b698b9942cd1fe1cbf9080d0bd952dbf.zip
r20460: Simplfy the handling of password hashes in the samba3sam module.
Andrew Bartlett (This used to be commit 2959b4ba8bb5764ea654ae7b152284a4e02405ab)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/samba3sam.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samba3sam.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samba3sam.c b/source4/dsdb/samdb/ldb_modules/samba3sam.c
index 1653812b88..c66dbee360 100644
--- a/source4/dsdb/samdb/ldb_modules/samba3sam.c
+++ b/source4/dsdb/samdb/ldb_modules/samba3sam.c
@@ -246,15 +246,11 @@ static struct ldb_val hex2bin(struct ldb_module *module, TALLOC_CTX *ctx, const
{
struct ldb_val out;
struct samr_Password *pwd;
- pwd = smbpasswd_gethexpwd(ctx, talloc_strndup(ctx, (const char *)val->data, val->length));
+ pwd = smbpasswd_gethexpwd(ctx, (const char *)val->data);
if (!pwd) {
return data_blob(NULL, 0);
}
- out.data = talloc_memdup(ctx, pwd->hash, sizeof(pwd->hash));
- if (!out.data) {
- return data_blob(NULL, 0);
- }
- out.length = sizeof(pwd->hash);
+ out = data_blob_talloc(ctx, pwd->hash, sizeof(pwd->hash));
return out;
}
@@ -331,7 +327,7 @@ const struct ldb_map_attribute samba3_attributes[] =
/* sambaLMPassword -> lmPwdHash*/
{
- .local_name = "lmpwdhash",
+ .local_name = "lmPwdHash",
.type = MAP_CONVERT,
.u = {
.convert = {