passdb: Add discard_const_p() to pdb_samba_dsdb
authorAndrew Bartlett <abartlet@samba.org>
Wed, 12 Dec 2012 23:33:04 +0000 (10:33 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 10 Jan 2013 07:46:22 +0000 (18:46 +1100)
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/passdb/pdb_samba_dsdb.c

index 2552fb9..0ff2e0a 100644 (file)
@@ -384,7 +384,7 @@ static int pdb_samba_dsdb_replace_by_sam(struct pdb_samba_dsdb_state *state,
                bool changed_history = false;
                if (need_update(sam, PDB_LMPASSWD)) {
                        struct ldb_val val;
-                       val.data = pdb_get_lanman_passwd(sam);
+                       val.data = discard_const_p(uint8_t, pdb_get_lanman_passwd(sam));
                        if (!val.data) {
                                samdb_msg_add_delete(state->ldb, msg, msg,
                                                     "dBCSPwd");
@@ -396,7 +396,7 @@ static int pdb_samba_dsdb_replace_by_sam(struct pdb_samba_dsdb_state *state,
                }
                if (need_update(sam, PDB_NTPASSWD)) {
                        struct ldb_val val;
-                       val.data = pdb_get_nt_passwd(sam);
+                       val.data = discard_const_p(uint8_t, pdb_get_nt_passwd(sam));
                        if (!val.data) {
                                samdb_msg_add_delete(state->ldb, msg, msg,
                                                     "unicodePwd");