[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Tue May 11 01:14:18 MDT 2010


The branch, master has been updated
       via  8489934... Revert "s4:password_hash LDB module - don't break the provision"
       via  ad5b9ae... Revert "s4:password hash LDB module - check that password hashes are != NULL before copying them"
       via  8ff3800... s4:dsdb/password_hash: only try to handle a hash in the unicodePwd field if it's given
      from  b8c414b... README.Coding: fix good example

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8489934ce3cb1d11f94abab81ccdd00ee74d3d44
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 11 08:34:35 2010 +0200

    Revert "s4:password_hash LDB module - don't break the provision"
    
    This reverts commit 6276343ce1b7dd7d217e5a419c09f209f5f87379.
    
    This is not needed anymore.
    
    metze

commit ad5b9ae8dc5c410ac3d9a510a82aaef2551efb57
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 11 08:38:02 2010 +0200

    Revert "s4:password hash LDB module - check that password hashes are != NULL before copying them"
    
    This reverts commit fa87027592f71179c22f132e375038217bc9d36a.
    
    This check is done one level above now.
    
    metze

commit 8ff38004e8d7bd09e435901c315622e8d6af2403
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue May 11 08:32:40 2010 +0200

    s4:dsdb/password_hash: only try to handle a hash in the unicodePwd field if it's given
    
    Sorry, I removed this logic while cleaning up indentation levels...
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source4/dsdb/samdb/ldb_modules/password_hash.c |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 0334c6d..f9e7f52 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1675,9 +1675,6 @@ static int setup_io(struct ph_context *ac,
 		return LDB_ERR_CONSTRAINT_VIOLATION;
 	}
 
-	/* FIXME: fix to don't break provision */
-	io->ac->hash_values = true;
-
 	/* Only non-trust accounts have restrictions (possibly this test is the
 	 * wrong way around, but we like to be restrictive if possible */
 	io->u.restrictions = !(io->u.userAccountControl
@@ -1762,7 +1759,7 @@ static int setup_io(struct ph_context *ac,
 		io->n.cleartext_utf16 = quoted_utf16_2;
 		io->n.nt_hash = NULL;
 
-	} else {
+	} else if (quoted_utf16) {
 		/* We have only the hash available -> so no plaintext here */
 		if (!ac->hash_values) {
 			/* refuse the change if someone wants to change
@@ -1781,11 +1778,9 @@ static int setup_io(struct ph_context *ac,
 			return LDB_ERR_CONSTRAINT_VIOLATION;
 		}
 
-		if (quoted_utf16 != NULL) {
-			io->n.nt_hash = talloc(io->ac, struct samr_Password);
-			memcpy(io->n.nt_hash->hash, quoted_utf16->data,
-			       MIN(quoted_utf16->length, sizeof(io->n.nt_hash->hash)));
-		}
+		io->n.nt_hash = talloc(io->ac, struct samr_Password);
+		memcpy(io->n.nt_hash->hash, quoted_utf16->data,
+		       MIN(quoted_utf16->length, sizeof(io->n.nt_hash->hash)));
 	}
 
 	/* Checks and converts the previous "unicodePwd" attribute */
@@ -1821,7 +1816,7 @@ static int setup_io(struct ph_context *ac,
 
 		io->og.cleartext_utf16 = old_quoted_utf16_2;
 		io->og.nt_hash = NULL;
-	} else {
+	} else if (old_quoted_utf16) {
 		/* We have only the hash available -> so no plaintext here */
 		if (!ac->hash_values) {
 			/* refuse the change if someone wants to change
@@ -1832,11 +1827,9 @@ static int setup_io(struct ph_context *ac,
 			return LDB_ERR_UNWILLING_TO_PERFORM;
 		}
 
-		if (old_quoted_utf16 != NULL) {
-			io->og.nt_hash = talloc(io->ac, struct samr_Password);
-			memcpy(io->og.nt_hash->hash, old_quoted_utf16->data,
-			       MIN(old_quoted_utf16->length, sizeof(io->og.nt_hash->hash)));
-		}
+		io->og.nt_hash = talloc(io->ac, struct samr_Password);
+		memcpy(io->og.nt_hash->hash, old_quoted_utf16->data,
+		       MIN(old_quoted_utf16->length, sizeof(io->og.nt_hash->hash)));
 	}
 
 	/* Handles the "dBCSPwd" attribute (LM hash) */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list