* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* This is the implementation of the netlogon pipe. */
uint32 logon_attempts = 0x0;
uint32 tc_status;
fstring servername, domain, dc_name, dc_name2;
- struct in_addr dc_ip;
+ struct sockaddr_storage dc_ss;
/* this should be \\global_myname() */
unistr2_to_ascii(servername, &q_u->uni_server_name, sizeof(servername));
if ( !is_trusted_domain( domain ) )
break;
- if ( !get_dc_name( domain, NULL, dc_name2, &dc_ip ) ) {
+ if ( !get_dc_name( domain, NULL, dc_name2, &dc_ss ) ) {
tc_status = ERROR_NO_LOGON_SERVERS;
break;
}
if ( !is_trusted_domain( domain ) )
break;
- if ( !get_dc_name( domain, NULL, dc_name2, &dc_ip ) ) {
+ if ( !get_dc_name( domain, NULL, dc_name2, &dc_ss ) ) {
tc_status = ERROR_NO_LOGON_SERVERS;
break;
}
{
struct samu *sampass = NULL;
const uint8 *pass;
- BOOL ret;
+ bool ret;
uint32 acct_ctrl;
-
+
#if 0
+ char addr[INET6_ADDRSTRLEN];
+
/*
* Currently this code is redundent as we already have a filter
* by hostname list. What this code really needs to do is to
*/
if (!allow_access(lp_domain_hostsdeny(), lp_domain_hostsallow(),
- client_name(), client_addr()))
- {
+ client_name(get_client_fd()),
+ client_addr(get_client_fd(),addr,sizeof(addr)))) {
DEBUG(0,("get_md4pw: Workstation %s denied access to domain\n", mach_acct));
return False;
}
{
fstring remote_machine;
struct samu *sampass=NULL;
- BOOL ret = False;
+ bool ret = False;
unsigned char pwd[16];
int i;
uint32 acct_ctrl;
if (!p->dc) {
/* Restore the saved state of the netlogon creds. */
- BOOL ret;
+ bool ret;
become_root();
ret = secrets_restore_schannel_session_info(p->pipe_state_mem_ctx,
static NTSTATUS _net_sam_logon_internal(pipes_struct *p,
NET_Q_SAM_LOGON *q_u,
NET_R_SAM_LOGON *r_u,
- BOOL process_creds)
+ bool process_creds)
{
NTSTATUS status = NT_STATUS_OK;
NET_USER_INFO_3 *usr_info = NULL;
if (!p->dc) {
/* Restore the saved state of the netlogon creds. */
- BOOL ret;
+ bool ret;
become_root();
ret = secrets_restore_schannel_session_info(p->pipe_state_mem_ctx,
/* This is the point at which, if the login was successful, that
the SAM Local Security Authority should record that the user is
logged in to the domain. */
-
+
{
DOM_GID *gids = NULL;
const DOM_SID *user_sid = NULL;
const DOM_SID *group_sid = NULL;
DOM_SID domain_sid;
- uint32 user_rid, group_rid;
+ uint32 user_rid, group_rid;
int num_gids = 0;
- pstring my_name;
- fstring user_sid_string;
- fstring group_sid_string;
+ const char *my_name;
unsigned char user_session_key[16];
unsigned char lm_session_key[16];
unsigned char pipe_session_key[16];
DEBUG(1, ("_net_sam_logon: user %s\\%s has user sid "
"%s\n but group sid %s.\n"
"The conflicting domain portions are not "
- "supported for NETLOGON calls\n",
+ "supported for NETLOGON calls\n",
pdb_get_domain(sampw),
pdb_get_username(sampw),
- sid_to_string(user_sid_string, user_sid),
- sid_to_string(group_sid_string, group_sid)));
+ sid_string_dbg(user_sid),
+ sid_string_dbg(group_sid)));
return NT_STATUS_UNSUCCESSFUL;
}
-
-
+
if(server_info->login_server) {
- pstrcpy(my_name, server_info->login_server);
+ my_name = server_info->login_server;
} else {
- pstrcpy(my_name, global_myname());
+ my_name = global_myname();
}
status = nt_token_to_group_list(p->mem_ctx, &domain_sid,
if (server_info->user_session_key.length) {
memcpy(user_session_key,
- server_info->user_session_key.data,
+ server_info->user_session_key.data,
MIN(sizeof(user_session_key),
server_info->user_session_key.length));
if (process_creds) {
}
if (server_info->lm_session_key.length) {
memcpy(lm_session_key,
- server_info->lm_session_key.data,
+ server_info->lm_session_key.data,
MIN(sizeof(lm_session_key),
server_info->lm_session_key.length));
if (process_creds) {
SamOEMhash(lm_session_key, pipe_session_key, 16);
memset(pipe_session_key, '\0', 16);
}
-
- init_net_user_info3(p->mem_ctx, usr_info,
+
+ init_net_user_info3(p->mem_ctx, usr_info,
user_rid,
- group_rid,
+ group_rid,
pdb_get_username(sampw),
pdb_get_fullname(sampw),
pdb_get_homedir(sampw),
server_info->lm_session_key.length ? lm_session_key : NULL,
my_name , /* char *logon_srv */
pdb_get_domain(sampw),
- &domain_sid); /* DOM_SID *dom_sid */
+ &domain_sid); /* DOM_SID *dom_sid */
ZERO_STRUCT(user_session_key);
ZERO_STRUCT(lm_session_key);
}