summaryrefslogtreecommitdiff
path: root/source4/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'source4/gtk')
-rw-r--r--source4/gtk/common/gtk-smb.c19
-rw-r--r--source4/gtk/common/gtk-smb.h4
-rw-r--r--source4/gtk/tools/gepdump.c3
-rw-r--r--source4/gtk/tools/gregedit.c3
-rw-r--r--source4/gtk/tools/gwcrontab.c5
-rw-r--r--source4/gtk/tools/gwsam.c6
6 files changed, 14 insertions, 26 deletions
diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c
index f42516c854..06bca9bf86 100644
--- a/source4/gtk/common/gtk-smb.c
+++ b/source4/gtk/common/gtk-smb.c
@@ -297,19 +297,14 @@ GtkWidget *gtk_rpc_binding_dialog_new (BOOL nocredentials, struct sam_pipe *sam_
return GTK_WIDGET(d);
}
-const char *gtk_rpc_binding_dialog_get_username(GtkRpcBindingDialog *d)
+struct cli_credentials *gtk_rpc_binding_dialog_get_credentials(GtkRpcBindingDialog *d)
{
- return gtk_entry_get_text(GTK_ENTRY(d->entry_username));
-}
-
-const char *gtk_rpc_binding_dialog_get_userdomain(GtkRpcBindingDialog *d)
-{
- return gtk_entry_get_text(GTK_ENTRY(d->entry_userdomain));
-}
-
-const char *gtk_rpc_binding_dialog_get_password(GtkRpcBindingDialog *d)
-{
- return gtk_entry_get_text(GTK_ENTRY(d->entry_password));
+ struct cli_credentials *ret = talloc(d->mem_ctx, struct cli_credentials);
+ cli_credentials_set_username(ret, gtk_entry_get_text(GTK_ENTRY(d->entry_username)), CRED_SPECIFIED);
+ cli_credentials_set_password(ret, gtk_entry_get_text(GTK_ENTRY(d->entry_password)), CRED_SPECIFIED);
+ cli_credentials_set_domain(ret, gtk_entry_get_text(GTK_ENTRY(d->entry_userdomain)), CRED_SPECIFIED);
+
+ return ret;
}
const char *gtk_rpc_binding_dialog_get_host(GtkRpcBindingDialog *d)
diff --git a/source4/gtk/common/gtk-smb.h b/source4/gtk/common/gtk-smb.h
index e85eb5be85..e78e8541f8 100644
--- a/source4/gtk/common/gtk-smb.h
+++ b/source4/gtk/common/gtk-smb.h
@@ -71,9 +71,7 @@ const char *gtk_select_host_dialog_get_host (GtkSelectHostDialog *d);
GType gtk_select_host_dialog_get_type (void);
void gtk_show_werror(GtkWidget *win, WERROR err);
const char *gtk_rpc_binding_dialog_get_binding_string(GtkRpcBindingDialog *d, TALLOC_CTX *mem_ctx);
-const char *gtk_rpc_binding_dialog_get_username(GtkRpcBindingDialog *d);
-const char *gtk_rpc_binding_dialog_get_userdomain(GtkRpcBindingDialog *d);
-const char *gtk_rpc_binding_dialog_get_password(GtkRpcBindingDialog *d);
+struct cli_credentials *gtk_rpc_binding_dialog_get_credentials(GtkRpcBindingDialog *d);
const char *gtk_rpc_binding_dialog_get_host(GtkRpcBindingDialog *d);
GtkWidget *gtk_select_domain_dialog_new (struct dcerpc_pipe *sam_pipe);
GType gtk_select_domain_dialog_get_type (void);
diff --git a/source4/gtk/tools/gepdump.c b/source4/gtk/tools/gepdump.c
index eeb927e43f..9a7d363a5e 100644
--- a/source4/gtk/tools/gepdump.c
+++ b/source4/gtk/tools/gepdump.c
@@ -25,6 +25,7 @@
#include "librpc/gen_ndr/ndr_mgmt.h"
#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
+#include "lib/cmdline/popt_common.h"
/*
* Show:
@@ -189,7 +190,7 @@ static void on_connect_clicked(GtkButton *btn, gpointer user_data)
status = dcerpc_pipe_connect(&epmapper_pipe, bs,
DCERPC_EPMAPPER_UUID, DCERPC_EPMAPPER_VERSION,
- lp_netbios_name(), lp_workgroup(), "", "");
+ cmdline_credentials);
if (NT_STATUS_IS_ERR(status)) {
gtk_show_ntstatus(mainwin, status);
diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c
index 5c3f94cdba..ec4be2f57c 100644
--- a/source4/gtk/tools/gregedit.c
+++ b/source4/gtk/tools/gregedit.c
@@ -405,8 +405,7 @@ static void on_open_remote_activate(GtkMenuItem *menuitem, gpointer user_data)
}
error = reg_open_remote(&registry,
- gtk_rpc_binding_dialog_get_username(GTK_RPC_BINDING_DIALOG(rpcwin)),
- gtk_rpc_binding_dialog_get_password(GTK_RPC_BINDING_DIALOG(rpcwin)),
+ gtk_rpc_binding_dialog_get_credentials(GTK_RPC_BINDING_DIALOG(rpcwin)),
gtk_rpc_binding_dialog_get_binding_string(GTK_RPC_BINDING_DIALOG(rpcwin), mem_ctx));
if(!W_ERROR_IS_OK(error)) {
diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c
index 3212821c18..ad3c58ca83 100644
--- a/source4/gtk/tools/gwcrontab.c
+++ b/source4/gtk/tools/gwcrontab.c
@@ -107,10 +107,7 @@ on_connect_activate (GtkMenuItem *menuitem,
gtk_rpc_binding_dialog_get_binding(d, mem_ctx),
DCERPC_ATSVC_UUID,
DCERPC_ATSVC_VERSION,
- lp_netbios_name(),
- gtk_rpc_binding_dialog_get_userdomain(d),
- gtk_rpc_binding_dialog_get_username(d),
- gtk_rpc_binding_dialog_get_password(d));
+ gtk_rpc_binding_dialog_get_credentials(d));
if(!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, status);
diff --git a/source4/gtk/tools/gwsam.c b/source4/gtk/tools/gwsam.c
index 1a6bc37f2f..0d435b278c 100644
--- a/source4/gtk/tools/gwsam.c
+++ b/source4/gtk/tools/gwsam.c
@@ -131,10 +131,8 @@ static void connect_sam(void)
status = dcerpc_pipe_connect_b(&sam_pipe,
gtk_rpc_binding_dialog_get_binding(d, mem_ctx),
DCERPC_SAMR_UUID, DCERPC_SAMR_VERSION,
- lp_netbios_name(),
- gtk_rpc_binding_dialog_get_userdomain(d),
- gtk_rpc_binding_dialog_get_username(d),
- gtk_rpc_binding_dialog_get_password(d));
+ gtk_rpc_binding_dialog_get_credentials(d)
+ );
if(!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, status);