#include "../libcli/security/security.h"
#include "passdb.h"
#include "libsmb/libsmb.h"
+#include "auth/gensec/gensec.h"
enum pipe_auth_type_spnego {
PIPE_AUTH_TYPE_SPNEGO_NONE = 0,
{
tmp_set = tmp->cmd_set;
- if (!StrCaseCmp(argv[1], tmp_set->name))
+ if (!strcasecmp_m(argv[1], tmp_set->name))
{
printf("Available commands on the %s pipe:\n\n", tmp_set->name);
&cmd_entry->rpc_pipe);
break;
case DCERPC_AUTH_TYPE_SPNEGO:
+ {
+ /* won't happen, but if it does it will fail in cli_rpc_pipe_open_spnego() eventually */
+ const char *oid = "INVALID";
switch (pipe_default_auth_spnego_type) {
case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP:
- ntresult = cli_rpc_pipe_open_spnego_ntlmssp(
- cli, cmd_entry->interface,
- default_transport,
- pipe_default_auth_level,
- get_cmdline_auth_info_domain(auth_info),
- get_cmdline_auth_info_username(auth_info),
- get_cmdline_auth_info_password(auth_info),
- &cmd_entry->rpc_pipe);
+ oid = GENSEC_OID_NTLMSSP;
break;
case PIPE_AUTH_TYPE_SPNEGO_KRB5:
- ntresult = cli_rpc_pipe_open_spnego_krb5(
- cli, cmd_entry->interface,
- default_transport,
- pipe_default_auth_level,
- cli->desthost,
- NULL, NULL,
- &cmd_entry->rpc_pipe);
+ oid = GENSEC_OID_KERBEROS5;
break;
- default:
- ntresult = NT_STATUS_INTERNAL_ERROR;
}
- break;
- case DCERPC_AUTH_TYPE_NTLMSSP:
- ntresult = cli_rpc_pipe_open_ntlmssp(
+ ntresult = cli_rpc_pipe_open_spnego(
cli, cmd_entry->interface,
default_transport,
+ oid,
pipe_default_auth_level,
+ cli_state_remote_name(cli),
get_cmdline_auth_info_domain(auth_info),
get_cmdline_auth_info_username(auth_info),
get_cmdline_auth_info_password(auth_info),
&cmd_entry->rpc_pipe);
break;
- case DCERPC_AUTH_TYPE_SCHANNEL:
- ntresult = cli_rpc_pipe_open_schannel(
+ }
+ case DCERPC_AUTH_TYPE_NTLMSSP:
+ case DCERPC_AUTH_TYPE_KRB5:
+ ntresult = cli_rpc_pipe_open_generic_auth(
cli, cmd_entry->interface,
default_transport,
+ pipe_default_auth_type,
pipe_default_auth_level,
+ cli_state_remote_name(cli),
get_cmdline_auth_info_domain(auth_info),
+ get_cmdline_auth_info_username(auth_info),
+ get_cmdline_auth_info_password(auth_info),
&cmd_entry->rpc_pipe);
break;
- case DCERPC_AUTH_TYPE_KRB5:
- ntresult = cli_rpc_pipe_open_krb5(
+ case DCERPC_AUTH_TYPE_SCHANNEL:
+ ntresult = cli_rpc_pipe_open_schannel(
cli, cmd_entry->interface,
default_transport,
pipe_default_auth_level,
- cli->desthost,
- NULL, NULL,
+ get_cmdline_auth_info_domain(auth_info),
&cmd_entry->rpc_pipe);
break;
default:
}
ntresult = rpccli_netlogon_setup_creds(cmd_entry->rpc_pipe,
- cli->desthost, /* server name */
+ cmd_entry->rpc_pipe->desthost, /* server name */
get_cmdline_auth_info_domain(auth_info), /* domain */
- global_myname(), /* client name */
+ lp_netbios_name(), /* client name */
machine_account, /* machine account name */
trust_password,
sec_channel_type,
struct sockaddr_storage server_ss;
NTSTATUS nt_status;
static int opt_port = 0;
- fstring new_workgroup;
int result = 0;
TALLOC_CTX *frame = talloc_stackframe();
uint32_t flags = 0;
goto done;
}
- /* save the workgroup...
-
- FIXME!! do we need to do this for other options as well
- (or maybe a generic way to keep lp_load() from overwriting
- everything)? */
-
- fstrcpy( new_workgroup, lp_workgroup() );
-
/* Load smb.conf file */
- if (!lp_load(get_dyn_CONFIGFILE(),True,False,False,True))
+ if (!lp_load_global(get_dyn_CONFIGFILE()))
fprintf(stderr, "Can't load %s\n", get_dyn_CONFIGFILE());
- if ( strlen(new_workgroup) != 0 )
- set_global_myworkgroup( new_workgroup );
-
/*
* Get password
* from stdin if necessary
}
- nt_status = cli_full_connection(&cli, global_myname(), binding->host,
+ nt_status = cli_full_connection(&cli, lp_netbios_name(), binding->host,
opt_ipaddr ? &server_ss : NULL, opt_port,
"IPC$", "IPC",
get_cmdline_auth_info_username(rpcclient_auth_info),