return status;
}
+ TALLOC_FREE(sampass);
+
(*server_info)->guest = True;
status = create_local_token(*server_info);
(*server_info)->user_session_key = data_blob(zeros, sizeof(zeros));
(*server_info)->lm_session_key = data_blob(zeros, sizeof(zeros));
- alpha_strcpy(tmp, pdb_get_username(sampass), ". _-$", sizeof(tmp));
+ alpha_strcpy(tmp, (*server_info)->info3->base.account_name.string,
+ ". _-$", sizeof(tmp));
(*server_info)->sanitized_username = talloc_strdup(*server_info, tmp);
return NT_STATUS_OK;
become_root();
nt_status = make_server_info_sam(server_info, sampass);
unbecome_root();
- /*
- * sampass has been stolen to server_info.
- * So NULL it out to prevent segfaults.
- */
- sampass = NULL;
+
+ TALLOC_FREE(sampass);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("check_sam_security: make_server_info_sam() failed with '%s'\n", nt_errstr(nt_status)));
pdb_get_username(sampass), result->unix_name));
*server_info = result;
- /* Ensure that the sampass will be freed with the result */
- talloc_steal(result, sampass);
return NT_STATUS_OK;
}
DEBUG(10, ("found user %s in passdb, calling "
"make_server_info_sam\n", real_username));
ret = make_server_info_sam(&server_info, sampass);
+ TALLOC_FREE(sampass);
} else {
/*
* User not in passdb, make it up artificially
DEBUG(10, ("smb2: found user %s in passdb, calling "
"make_server_info_sam\n", real_username));
status = make_server_info_sam(&tmp_server_info, sampass);
+ TALLOC_FREE(sampass);
} else {
/*
* User not in passdb, make it up artificially