From adcc7299b698b9942cd1fe1cbf9080d0bd952dbf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 2 Jan 2007 03:40:29 +0000 Subject: r20460: Simplfy the handling of password hashes in the samba3sam module. Andrew Bartlett (This used to be commit 2959b4ba8bb5764ea654ae7b152284a4e02405ab) --- source4/dsdb/samdb/ldb_modules/samba3sam.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'source4') 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 = { -- cgit