passdb: Use "all_zero" where appropriate
authorVolker Lendecke <vl@samba.org>
Sat, 31 Dec 2016 12:45:51 +0000 (12:45 +0000)
committerRalph Boehme <slow@samba.org>
Tue, 3 Jan 2017 15:04:28 +0000 (16:04 +0100)
... Saves a few bytes of footprint

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/passdb/pdb_samba_dsdb.c

index 97806c4af2575474898e75f91713cbb5cfc3c6b0..97c05c6224ea055c268cb56ffa5b06e1ac3808f3 100644 (file)
@@ -443,10 +443,10 @@ static int pdb_samba_dsdb_replace_by_sam(struct pdb_samba_dsdb_state *state,
                                invalid_history = true;
                        } else {
                                unsigned int i;
-                               static const uint8_t zeros[16];
                                /* Parse the history into the correct format */
                                for (i = 0; i < current_hist_len; i++) {
-                                       if (memcmp(&history[i*PW_HISTORY_ENTRY_LEN], zeros, 16) != 0) {
+                                       if (!all_zero(&history[i*PW_HISTORY_ENTRY_LEN],
+                                                     16)) {
                                                /* If the history is in the old format, with a salted hash, then we can't migrate it to AD format */
                                                invalid_history = true;
                                                break;