TALLOC_CTX *mem_ctx = account;
const char *old_string, *new_string;
time_t unix_time, stored_time;
- uchar zero_buf[16];
NTSTATUS status;
NTTIME lastLogon;
uint32_t acct_flags;
uint32_t units_per_week;
- memset(zero_buf, '\0', sizeof(zero_buf));
-
objectSid = cur->object.identifier->sid;
GET_STRING_EX(sAMAccountName, true);
DEBUG(0,("sam_account_from_object(%s, %s) start\n",
think this channel is secure enough - don't set the passwords at all
in that case
*/
- if (dBCSPwd.length == 16 && memcmp(dBCSPwd.data, zero_buf, 16) != 0) {
+ if (dBCSPwd.length == 16 && !all_zero(dBCSPwd.data, 16)) {
pdb_set_lanman_passwd(account, dBCSPwd.data, PDB_CHANGED);
}
- if (unicodePwd.length == 16 && memcmp(unicodePwd.data, zero_buf, 16) != 0) {
+ if (unicodePwd.length == 16 && !all_zero(unicodePwd.data, 16)) {
pdb_set_nt_passwd(account, unicodePwd.data, PDB_CHANGED);
}
const char *keytab_name;
struct ads_struct *ads;
const char *dns_domain_name;
- uint8_t zero_buf[16];
uint32_t count;
struct libnet_keytab_entry *entries;
bool clean_old_entries;
struct netr_DELTA_USER *r)
{
fstring hex_nt_passwd, hex_lm_passwd;
- uchar zero_buf[16];
- memset(zero_buf, '\0', sizeof(zero_buf));
/* Decode hashes from password hash (if they are not NULL) */
- if (memcmp(r->lmpassword.hash, zero_buf, 16) != 0) {
+ if (!all_zero(r->lmpassword.hash, 16)) {
pdb_sethexpwd(hex_lm_passwd, r->lmpassword.hash, r->acct_flags);
} else {
pdb_sethexpwd(hex_lm_passwd, NULL, 0);
}
- if (memcmp(r->ntpassword.hash, zero_buf, 16) != 0) {
+ if (!all_zero(r->ntpassword.hash, 16)) {
pdb_sethexpwd(hex_nt_passwd, r->ntpassword.hash, r->acct_flags);
} else {
pdb_sethexpwd(hex_nt_passwd, NULL, 0);
uint32_t kvno = 0;
DATA_BLOB blob;
- if (memcmp(r->ntpassword.hash, ctx->zero_buf, 16) == 0) {
+ if (all_zero(r->ntpassword.hash, 16)) {
return NT_STATUS_OK;
}
char *flags, *user_rdn;
const char *ou;
const char* nopasswd = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
- uchar zero_buf[16];
uint32_t rid = 0, group_rid = 0, gidNumber = 0;
time_t unix_time;
int i, ret;
- memset(zero_buf, '\0', sizeof(zero_buf));
-
/* Get the username */
fstrcpy(username, r->account_name.string);
fstrcpy(profilepath, r->profile_path.string);
/* Get lm and nt password data */
- if (memcmp(r->lmpassword.hash, zero_buf, 16) != 0) {
+ if (!all_zero(r->lmpassword.hash, 16)) {
pdb_sethexpwd(hex_lm_passwd, r->lmpassword.hash, r->acct_flags);
} else {
pdb_sethexpwd(hex_lm_passwd, NULL, 0);
}
- if (memcmp(r->ntpassword.hash, zero_buf, 16) != 0) {
+ if (!all_zero(r->ntpassword.hash, 16)) {
pdb_sethexpwd(hex_nt_passwd, r->ntpassword.hash, r->acct_flags);
} else {
pdb_sethexpwd(hex_nt_passwd, NULL, 0);
{
const char *old_string, *new_string;
time_t unix_time, stored_time;
- uchar zero_buf[16];
-
- memset(zero_buf, '\0', sizeof(zero_buf));
/* Username, fullname, home dir, dir drive, logon script, acct
desc, workstations, profile. */
think this channel is secure enough - don't set the passwords at all
in that case
*/
- if (memcmp(r->lmpassword.hash, zero_buf, 16) != 0) {
+ if (!all_zero(r->lmpassword.hash, 16)) {
pdb_set_lanman_passwd(account, r->lmpassword.hash, PDB_CHANGED);
}
- if (memcmp(r->ntpassword.hash, zero_buf, 16) != 0) {
+ if (!all_zero(r->ntpassword.hash, 16)) {
pdb_set_nt_passwd(account, r->ntpassword.hash, PDB_CHANGED);
}