summaryrefslogtreecommitdiff
path: root/source4/gtk/tools
diff options
context:
space:
mode:
Diffstat (limited to 'source4/gtk/tools')
-rw-r--r--source4/gtk/tools/gwcrontab.c8
-rw-r--r--source4/gtk/tools/gwsam.c12
2 files changed, 17 insertions, 3 deletions
diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c
index b3137a9a19..97660c9225 100644
--- a/source4/gtk/tools/gwcrontab.c
+++ b/source4/gtk/tools/gwcrontab.c
@@ -85,6 +85,7 @@ on_connect_activate (GtkMenuItem *menuitem,
GtkRpcBindingDialog *d;
NTSTATUS status;
gint result;
+ TALLOC_CTX *mem_ctx;
d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(FALSE, NULL));
result = gtk_dialog_run(GTK_DIALOG(d));
@@ -96,16 +97,21 @@ on_connect_activate (GtkMenuItem *menuitem,
return;
}
+ mem_ctx = talloc_init("gwcrontab_connect");
/* If connected, get list of jobs */
- status = dcerpc_pipe_connect(&at_pipe, gtk_rpc_binding_dialog_get_binding(d, DCERPC_ATSVC_NAME), DCERPC_ATSVC_UUID, DCERPC_ATSVC_VERSION, lp_workgroup(), gtk_rpc_binding_dialog_get_username(d), gtk_rpc_binding_dialog_get_password(d));
+
+ status = dcerpc_pipe_connect_b(&at_pipe, gtk_rpc_binding_dialog_get_binding(d, mem_ctx), DCERPC_ATSVC_UUID, DCERPC_ATSVC_VERSION, lp_workgroup(), gtk_rpc_binding_dialog_get_username(d), gtk_rpc_binding_dialog_get_password(d));
+
if(!NT_STATUS_IS_OK(status)) {
gtk_show_ntstatus(mainwin, status);
at_pipe = NULL;
gtk_widget_destroy(GTK_WIDGET(d));
+ talloc_destroy(mem_ctx);
return;
}
gtk_widget_destroy(GTK_WIDGET(d));
+ talloc_destroy(mem_ctx);
update_joblist();
}
diff --git a/source4/gtk/tools/gwsam.c b/source4/gtk/tools/gwsam.c
index c6b68c5e3c..e31f9344e8 100644
--- a/source4/gtk/tools/gwsam.c
+++ b/source4/gtk/tools/gwsam.c
@@ -91,7 +91,7 @@ on_select_domain_activate (GtkMenuItem *menuitem,
d = GTK_SELECT_DOMAIN_DIALOG(gtk_select_domain_dialog_new(sam_pipe));
result = gtk_dialog_run(GTK_DIALOG(d));
switch(result) {
- case GTK_RESPONSE_ACCEPT:
+ case GTK_RESPONSE_OK:
break;
default:
gtk_widget_destroy(GTK_WIDGET(d));
@@ -105,7 +105,7 @@ on_select_domain_activate (GtkMenuItem *menuitem,
gtk_widget_destroy(GTK_WIDGET(d));
}
-void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data)
+static void connect_sam(void)
{
GtkRpcBindingDialog *d;
NTSTATUS status;
@@ -153,6 +153,12 @@ void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data)
gtk_window_set_title (GTK_WINDOW (mainwin), talloc_asprintf(mem_ctx, "User Manager - Connected to %s", gtk_rpc_binding_dialog_get_host(d)));
gtk_widget_destroy(GTK_WIDGET(d));
talloc_destroy(mem_ctx);
+
+}
+
+void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data)
+{
+ connect_sam();
}
void on_disconnect_activate (GtkMenuItem *menuitem, gpointer user_data)
@@ -431,9 +437,11 @@ create_mainwindow (void)
{
lp_load(dyn_CONFIGFILE,True,False,False);
load_interfaces();
+ setup_logging("gwsam", True);
gtk_init(&argc, &argv);
mainwin = create_mainwindow();
+ connect_sam();
gtk_widget_show(mainwin);
gtk_main();