From eb3b5f28d4686802070a770ef29bb71dd4d82d54 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 May 2005 13:46:49 +0000 Subject: r6600: Rework of the GTK credentials system; the credentials information is now in a seperate (optional) dialog rather then in the binding dialog; also supports specifying anonymous connections (which we didn't before). (This used to be commit 8671e1a1fa8ef416c1819f811653eff190d3074a) --- source4/gtk/tools/gepdump.c | 2 +- source4/gtk/tools/gregedit.c | 9 +++++++-- source4/gtk/tools/gwcrontab.c | 9 +++++++-- source4/gtk/tools/gwsam.c | 11 +++++++---- 4 files changed, 22 insertions(+), 9 deletions(-) (limited to 'source4/gtk/tools') diff --git a/source4/gtk/tools/gepdump.c b/source4/gtk/tools/gepdump.c index 97ba90abfe..33e91e1436 100644 --- a/source4/gtk/tools/gepdump.c +++ b/source4/gtk/tools/gepdump.c @@ -178,7 +178,7 @@ static void on_connect_clicked(GtkButton *btn, gpointer user_data) gint result; struct cli_credentials *credentials; - d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(TRUE, NULL)); + d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(NULL)); result = gtk_dialog_run(GTK_DIALOG(d)); switch(result) { case GTK_RESPONSE_ACCEPT: diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c index 472a5683ed..5a9994df9c 100644 --- a/source4/gtk/tools/gregedit.c +++ b/source4/gtk/tools/gregedit.c @@ -396,9 +396,10 @@ static void on_open_local_activate(GtkMenuItem *menuitem, gpointer user_data) static void on_open_remote_activate(GtkMenuItem *menuitem, gpointer user_data) { char *tmp; - GtkWidget *rpcwin = GTK_WIDGET(gtk_rpc_binding_dialog_new(FALSE, NULL)); + GtkWidget *rpcwin = GTK_WIDGET(gtk_rpc_binding_dialog_new(NULL)); gint result = gtk_dialog_run(GTK_DIALOG(rpcwin)); WERROR error; + struct cli_credentials *creds; if(result != GTK_RESPONSE_ACCEPT) { @@ -406,8 +407,12 @@ static void on_open_remote_activate(GtkMenuItem *menuitem, gpointer user_data) return; } + creds = cli_credentials_init(mem_ctx); + cli_credentials_guess(creds); + cli_credentials_set_gtk_callbacks(creds); + error = reg_open_remote(®istry, - gtk_rpc_binding_dialog_get_credentials(GTK_RPC_BINDING_DIALOG(rpcwin)), + creds, 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 a1b57225db..2a8ee5049e 100644 --- a/source4/gtk/tools/gwcrontab.c +++ b/source4/gtk/tools/gwcrontab.c @@ -87,10 +87,11 @@ on_connect_activate (GtkMenuItem *menuitem, { GtkRpcBindingDialog *d; NTSTATUS status; + struct cli_credentials *credentials; gint result; TALLOC_CTX *mem_ctx; - d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(FALSE, NULL)); + d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(NULL)); result = gtk_dialog_run(GTK_DIALOG(d)); switch(result) { case GTK_RESPONSE_ACCEPT: @@ -102,12 +103,16 @@ on_connect_activate (GtkMenuItem *menuitem, mem_ctx = talloc_init("gwcrontab_connect"); /* If connected, get list of jobs */ + + credentials = cli_credentials_init(mem_ctx); + cli_credentials_guess(credentials); + cli_credentials_set_gtk_callbacks(credentials); status = dcerpc_pipe_connect_b(mem_ctx, &at_pipe, gtk_rpc_binding_dialog_get_binding(d, mem_ctx), DCERPC_ATSVC_UUID, DCERPC_ATSVC_VERSION, - gtk_rpc_binding_dialog_get_credentials(d)); + credentials); if(!NT_STATUS_IS_OK(status)) { gtk_show_ntstatus(mainwin, "Error while connecting to at service", status); diff --git a/source4/gtk/tools/gwsam.c b/source4/gtk/tools/gwsam.c index 71765424d7..f712d43ba1 100644 --- a/source4/gtk/tools/gwsam.c +++ b/source4/gtk/tools/gwsam.c @@ -113,10 +113,11 @@ static void connect_sam(void) GtkRpcBindingDialog *d; NTSTATUS status; struct samr_Connect r; + struct cli_credentials *cred; TALLOC_CTX *mem_ctx; gint result; - d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(FALSE, NULL)); + d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(NULL)); result = gtk_dialog_run(GTK_DIALOG(d)); switch(result) { case GTK_RESPONSE_ACCEPT: @@ -127,12 +128,14 @@ static void connect_sam(void) } mem_ctx = talloc_init("gwsam_connect"); + cred = cli_credentials_init(mem_ctx); + cli_credentials_guess(cred); + cli_credentials_set_gtk_callbacks(cred); + /* If connected, get list of jobs */ status = dcerpc_pipe_connect_b(mem_ctx, &sam_pipe, gtk_rpc_binding_dialog_get_binding(d, mem_ctx), - DCERPC_SAMR_UUID, DCERPC_SAMR_VERSION, - gtk_rpc_binding_dialog_get_credentials(d) - ); + DCERPC_SAMR_UUID, DCERPC_SAMR_VERSION, cred ); if(!NT_STATUS_IS_OK(status)) { gtk_show_ntstatus(mainwin, "While connecting to SAMR interface", status); -- cgit