ntlmssp_flags = user_info->ntlmssp_flags;
if (nt_pw == NULL) {
- DEBUG(3,("smb_password_ok: NO NT password stored for user %s.\n",
+ DEBUG(3,("sam_password_ok: NO NT password stored for user %s.\n",
pdb_get_username(sampass)));
/* No return, we want to check the LM hash below in this case */
ntlmssp_flags &= (~(NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_NTLM2));
/* We have the NT MD4 hash challenge available - see if we can
use it (ie. does it exist in the smbpasswd file).
*/
- DEBUG(4,("smb_password_ok: Checking NTLMv2 password\n"));
+ DEBUG(4,("sam_password_ok: Checking NTLMv2 password\n"));
if (smb_pwd_check_ntlmv2( user_info->nt_resp,
nt_pw, auth_info->challenge,
user_info->smb_name.str,
{
return NT_STATUS_OK;
} else {
- DEBUG(3,("smb_password_ok: NTLMv2 password check failed\n"));
+ DEBUG(3,("sam_password_ok: NTLMv2 password check failed\n"));
return NT_STATUS_WRONG_PASSWORD;
}
} else if (ntlmssp_flags & NTLMSSP_NEGOTIATE_NTLM) {
/* We have the NT MD4 hash challenge available - see if we can
use it (ie. does it exist in the smbpasswd file).
*/
- DEBUG(4,("smb_password_ok: Checking NT MD4 password\n"));
+ DEBUG(4,("sam_password_ok: Checking NT MD4 password\n"));
if (smb_pwd_check_ntlmv1(user_info->nt_resp,
nt_pw, auth_info->challenge,
user_sess_key))
{
return NT_STATUS_OK;
} else {
- DEBUG(3,("smb_password_ok: NT MD4 password check failed for user %s\n",pdb_get_username(sampass)));
+ DEBUG(3,("sam_password_ok: NT MD4 password check failed for user %s\n",pdb_get_username(sampass)));
return NT_STATUS_WRONG_PASSWORD;
}
} else {
- DEBUG(2,("smb_password_ok: NTLMv1 passwords NOT PERMITTED for user %s\n",pdb_get_username(sampass)));
+ DEBUG(2,("sam_password_ok: NTLMv1 passwords NOT PERMITTED for user %s\n",pdb_get_username(sampass)));
/* No return, we want to check the LM hash below in this case */
}
}
if (lm_pw == NULL) {
- DEBUG(3,("smb_password_ok: NO LanMan password set for user %s (and no NT password supplied)\n",pdb_get_username(sampass)));
+ DEBUG(3,("sam_password_ok: NO LanMan password set for user %s (and no NT password supplied)\n",pdb_get_username(sampass)));
ntlmssp_flags &= (~NTLMSSP_NEGOTIATE_OEM);
}
if (ntlmssp_flags & NTLMSSP_NEGOTIATE_OEM) {
if (user_info->lm_resp.length != 24) {
- DEBUG(2,("smb_password_ok: invalid LanMan password length (%d) for user %s\n",
+ DEBUG(2,("sam_password_ok: invalid LanMan password length (%d) for user %s\n",
user_info->nt_resp.length, pdb_get_username(sampass)));
}
if (!lp_lanman_auth()) {
- DEBUG(3,("smb_password_ok: Lanman passwords NOT PERMITTED for user %s\n",pdb_get_username(sampass)));
+ DEBUG(3,("sam_password_ok: Lanman passwords NOT PERMITTED for user %s\n",pdb_get_username(sampass)));
return NT_STATUS_LOGON_FAILURE;
}
- DEBUG(4,("smb_password_ok: Checking LM password\n"));
+ DEBUG(4,("sam_password_ok: Checking LM password\n"));
if (smb_pwd_check_ntlmv1(user_info->lm_resp,
lm_pw, auth_info->challenge,
user_sess_key))
{
return NT_STATUS_OK;
} else {
- DEBUG(4,("smb_password_ok: LM password check failed for user %s\n",pdb_get_username(sampass)));
+ DEBUG(4,("sam_password_ok: LM password check failed for user %s\n",pdb_get_username(sampass)));
return NT_STATUS_WRONG_PASSWORD;
}
}
/* Should not be reached, but if they send nothing... */
- DEBUG(3,("smb_password_ok: NEITHER LanMan nor NT password supplied for user %s\n",pdb_get_username(sampass)));
+ DEBUG(3,("sam_password_ok: NEITHER LanMan nor NT password supplied for user %s\n",pdb_get_username(sampass)));
return NT_STATUS_WRONG_PASSWORD;
}
char *workstation_list;
time_t kickoff_time;
- DEBUG(4,("smb_password_ok: Checking SMB password for user %s\n",pdb_get_username(sampass)));
+ DEBUG(4,("sam_account_ok: Checking SMB password for user %s\n",pdb_get_username(sampass)));
/* Quit if the account was disabled. */
if (acct_ctrl & ACB_DISABLED) {
}
if (acct_ctrl & ACB_DOMTRUST) {
- DEBUG(2,("session_trust_account: Domain trust account %s denied by server\n", pdb_get_username(sampass)));
+ DEBUG(2,("sam_account_ok: Domain trust account %s denied by server\n", pdb_get_username(sampass)));
return NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT;
}
if (acct_ctrl & ACB_SVRTRUST) {
- DEBUG(2,("session_trust_account: Server trust account %s denied by server\n", pdb_get_username(sampass)));
+ DEBUG(2,("sam_account_ok: Server trust account %s denied by server\n", pdb_get_username(sampass)));
return NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT;
}
if (acct_ctrl & ACB_WSTRUST) {
- DEBUG(4,("session_trust_account: Wksta trust account %s denied by server\n", pdb_get_username(sampass)));
+ DEBUG(4,("sam_account_ok: Wksta trust account %s denied by server\n", pdb_get_username(sampass)));
return NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT;
}
return TDB_ERRCODE(TDB_ERR_OOM, buf);
}
if (tdb_read(tdb, offset, buf, len, 0) == -1) {
- free(buf);
+ SAFE_FREE(buf);
return NULL;
}
return buf;
}
if (tailer != rec.rec_len + sizeof(rec)) {
- printf("ERROR: tailer does not match record! tailer=%u totalsize=%u\n",
- (unsigned)tailer, (unsigned)(rec.rec_len + sizeof(rec)));
+ printf("ERROR: tailer does not match record! tailer=%u totalsize=%u\n",
+ (unsigned)tailer, (unsigned)(rec.rec_len + sizeof(rec)));
}
return rec.next;
}
void tdb_printfreelist(TDB_CONTEXT *tdb)
{
long total_free = 0;
- tdb_off offset, rec_ptr, last_ptr;
+ tdb_off offset, rec_ptr;
struct list_struct rec;
tdb_lock(tdb, -1, F_WRLCK);
- last_ptr = 0;
offset = FREELIST_TOP;
/* read in the freelist top */
ret = tdb_create_rwlocks(tdb->fd, hash_size);
fail:
- free(newdb);
+ SAFE_FREE(newdb);
return ret;
}
return 0;
if (memcmp(key.dptr, k, key.dsize) == 0) {
- free(k);
+ SAFE_FREE(k);
return rec_ptr;
}
- free(k);
+ SAFE_FREE(k);
}
rec_ptr = r->next;
}
/* They want us to terminate traversal */
unlock_record(tdb, tl.off);
tdb->travlocks.next = tl.next;
- free(key.dptr);
+ SAFE_FREE(key.dptr);
return count;
}
- free(key.dptr);
+ SAFE_FREE(key.dptr);
}
tdb->travlocks.next = tl.next;
if (ret < 0)
tdb->travlocks.off = 0;
}
- if (k)
- free(k);
+ SAFE_FREE(k);
}
if (!tdb->travlocks.off) {
ret = -1;
}
out:
- if (p)
- free(p);
+ SAFE_FREE(p);
tdb_unlock(tdb, BUCKET(hash), F_WRLCK);
return ret;
}
if (tdb->map_ptr) {
if (tdb->flags & TDB_INTERNAL)
- free(tdb->map_ptr);
+ SAFE_FREE(tdb->map_ptr);
else
tdb_munmap(tdb);
}
- if (tdb->name)
- free(tdb->name);
+ SAFE_FREE(tdb->name);
if (tdb->fd != -1)
close(tdb->fd);
- if (tdb->locked)
- free(tdb->locked);
+ SAFE_FREE(tdb->locked);
errno = save_errno;
return NULL;
}
if (tdb->map_ptr) {
if (tdb->flags & TDB_INTERNAL)
- free(tdb->map_ptr);
+ SAFE_FREE(tdb->map_ptr);
else
tdb_munmap(tdb);
}
- if (tdb->name)
- free(tdb->name);
+ SAFE_FREE(tdb->name);
if (tdb->fd != -1)
ret = close(tdb->fd);
- if (tdb->locked)
- free(tdb->locked);
- if (tdb->lockedkeys)
- free(tdb->lockedkeys);
+ SAFE_FREE(tdb->locked);
+ SAFE_FREE(tdb->lockedkeys);
/* Remove from contexts list */
for (i = &tdbs; *i; i = &(*i)->next) {
}
memset(tdb, 0, sizeof(*tdb));
- free(tdb);
+ SAFE_FREE(tdb);
return ret;
}
if (i < number) {
for ( j = 0; j < i; j++)
tdb_unlock(tdb, j, F_WRLCK);
- free(tdb->lockedkeys);
- tdb->lockedkeys = NULL;
+ SAFE_FREE(tdb->lockedkeys);
return TDB_ERRCODE(TDB_ERR_NOLOCK, -1);
}
return 0;
u32 i;
for (i = 0; i < tdb->lockedkeys[0]; i++)
tdb_unlock(tdb, tdb->lockedkeys[i+1], F_WRLCK);
- free(tdb->lockedkeys);
- tdb->lockedkeys = NULL;
+ SAFE_FREE(tdb->lockedkeys);
}
/* lock/unlock one hash chain. This is meant to be used to reduce