From 2959b4ba8bb5764ea654ae7b152284a4e02405ab Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 2 Jan 2007 03:40:29 +0000 Subject: [PATCH] r20460: Simplfy the handling of password hashes in the samba3sam module. Andrew Bartlett --- source/dsdb/samdb/ldb_modules/samba3sam.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/dsdb/samdb/ldb_modules/samba3sam.c b/source/dsdb/samdb/ldb_modules/samba3sam.c index 1653812b880..c66dbee360d 100644 --- a/source/dsdb/samdb/ldb_modules/samba3sam.c +++ b/source/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 = { -- 2.11.4.GIT