diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-10-25 11:47:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:42 -0500 |
commit | 00f43d5eebe59d3bc85ed96fd7051f3c6050a694 (patch) | |
tree | 94fb789a6fab3907fd30c45865bb18002c414f4b | |
parent | 90732ae5490bcbf3e6d3dec2afe37a99fdf8cb16 (diff) | |
download | samba-00f43d5eebe59d3bc85ed96fd7051f3c6050a694.tar.gz samba-00f43d5eebe59d3bc85ed96fd7051f3c6050a694.tar.bz2 samba-00f43d5eebe59d3bc85ed96fd7051f3c6050a694.zip |
r3213: Make credentials in a binding dialog optional
Small fixes in gepdump
(This used to be commit a9473750f65d331c52acde58485aca66b16d1f75)
-rw-r--r-- | source4/gtk/common/gtk-smb.c | 44 | ||||
-rw-r--r-- | source4/gtk/common/gtk-smb.h | 1 | ||||
-rw-r--r-- | source4/gtk/tools/gepdump.c | 19 |
3 files changed, 33 insertions, 31 deletions
diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c index 5fa0f283c6..016b162aa8 100644 --- a/source4/gtk/common/gtk-smb.c +++ b/source4/gtk/common/gtk-smb.c @@ -78,7 +78,6 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di GtkWidget *frame_security; GtkWidget *vbox2; GtkWidget *label3; - GtkWidget *frame_credentials; GtkWidget *table1; GtkWidget *lbl_username; GtkWidget *lbl_password; @@ -186,59 +185,59 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di gtk_widget_show (label3); gtk_frame_set_label_widget (GTK_FRAME (frame_security), label3); - frame_credentials = gtk_frame_new (NULL); - gtk_widget_show (frame_credentials); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), frame_credentials, TRUE, TRUE, 0); + gtk_rpc_binding_dialog->frame_credentials = gtk_frame_new (NULL); + gtk_widget_show (gtk_rpc_binding_dialog->frame_credentials); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), gtk_rpc_binding_dialog->frame_credentials, TRUE, TRUE, 0); table1 = gtk_table_new (3, 2, FALSE); gtk_widget_show (table1); - gtk_container_add (GTK_CONTAINER (frame_credentials), table1); + gtk_container_add (GTK_CONTAINER (gtk_rpc_binding_dialog->frame_credentials), table1); lbl_username = gtk_label_new ("Username:"); gtk_widget_show (lbl_username); gtk_table_attach (GTK_TABLE (table1), lbl_username, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (lbl_username), 0, 0.5); lbl_password = gtk_label_new ("Password:"); gtk_widget_show (lbl_password); gtk_table_attach (GTK_TABLE (table1), lbl_password, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (lbl_password), 0, 0.5); label9 = gtk_label_new (""); gtk_widget_show (label9); gtk_table_attach (GTK_TABLE (table1), label9, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5); gtk_rpc_binding_dialog->entry_password = gtk_entry_new (); gtk_entry_set_visibility (GTK_ENTRY (gtk_rpc_binding_dialog->entry_password), FALSE); gtk_widget_show (gtk_rpc_binding_dialog->entry_password); gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->entry_password, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); gtk_rpc_binding_dialog->entry_username = gtk_entry_new (); gtk_widget_show (gtk_rpc_binding_dialog->entry_username); gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->entry_username, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); gtk_entry_set_text(GTK_ENTRY(gtk_rpc_binding_dialog->entry_username), getenv("LOGNAME")); gtk_rpc_binding_dialog->krb5_chk_button = gtk_check_button_new_with_mnemonic ("_Use kerberos"); gtk_widget_show (gtk_rpc_binding_dialog->krb5_chk_button); gtk_table_attach (GTK_TABLE (table1), gtk_rpc_binding_dialog->krb5_chk_button, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); - g_signal_connect ((gpointer) gtk_rpc_binding_dialog->krb5_chk_button, "toggled", - G_CALLBACK (on_krb5_toggled), - gtk_rpc_binding_dialog); + g_signal_connect ((gpointer) gtk_rpc_binding_dialog->krb5_chk_button, "toggled", + G_CALLBACK (on_krb5_toggled), + gtk_rpc_binding_dialog); /* Poor man's autodetection */ if(getenv("KRB5CCNAME")) { @@ -247,7 +246,7 @@ static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_di lbl_credentials = gtk_label_new ("Credentials"); gtk_widget_show (lbl_credentials); - gtk_frame_set_label_widget (GTK_FRAME (frame_credentials), lbl_credentials); + gtk_frame_set_label_widget (GTK_FRAME (gtk_rpc_binding_dialog->frame_credentials), lbl_credentials); dialog_action_area1 = GTK_DIALOG (gtk_rpc_binding_dialog)->action_area; gtk_widget_show (dialog_action_area1); @@ -304,6 +303,9 @@ GType gtk_rpc_binding_dialog_get_type (void) GtkWidget *gtk_rpc_binding_dialog_new (BOOL nocredentials, struct sam_pipe *sam_pipe) { GtkRpcBindingDialog *d = GTK_RPC_BINDING_DIALOG ( gtk_type_new (gtk_rpc_binding_dialog_get_type ())); + if (nocredentials) { + gtk_widget_hide_all(d->frame_credentials); + } d->sam_pipe = sam_pipe; return GTK_WIDGET(d); } diff --git a/source4/gtk/common/gtk-smb.h b/source4/gtk/common/gtk-smb.h index 46c712794a..6e82678c75 100644 --- a/source4/gtk/common/gtk-smb.h +++ b/source4/gtk/common/gtk-smb.h @@ -41,6 +41,7 @@ struct _GtkRpcBindingDialog GtkWidget *entry_username; GtkWidget *entry_password; GtkWidget *krb5_chk_button; + GtkWidget *frame_credentials; TALLOC_CTX *mem_ctx; struct sam_pipe *sam_pipe; }; diff --git a/source4/gtk/tools/gepdump.c b/source4/gtk/tools/gepdump.c index 05d3ed2425..94615e3de0 100644 --- a/source4/gtk/tools/gepdump.c +++ b/source4/gtk/tools/gepdump.c @@ -22,21 +22,19 @@ #include "includes.h" #include "gtk/common/gtk-smb.h" -GtkWidget *mainwin; -GtkWidget *entry_binding; -GtkTreeStore *store_eps; +static GtkWidget *mainwin; +static GtkWidget *entry_binding; +static GtkTreeStore *store_eps; -static void on_quit1_activate (GtkMenuItem *menuitem, - gpointer user_data) +static void on_quit1_activate (GtkMenuItem *menuitem, gpointer user_data) { gtk_main_quit(); } -static void on_about1_activate (GtkMenuItem *menuitem, - gpointer user_data) +static void on_about1_activate (GtkMenuItem *menuitem, gpointer user_data) { - GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog("gsmbtorture")); + GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog("gepdump")); gtk_dialog_run(aboutwin); gtk_widget_destroy(GTK_WIDGET(aboutwin)); } @@ -53,6 +51,7 @@ static const char *get_protocol_name(enum epm_protocols protocol) case EPM_PROTOCOL_NETBIOS: return "NetBIOS"; case EPM_PROTOCOL_SMB: return "SMB"; case EPM_PROTOCOL_PIPE: return "PIPE"; + case EPM_PROTOCOL_UNIX_DS: return "Unix"; default: return "Unknown"; } } @@ -91,7 +90,7 @@ static void add_epm_entry(TALLOC_CTX *mem_ctx, const char *annotation, struct ep } } -static void on_dump_clicked (GtkButton *btn, gpointer user_data) +static void on_dump_clicked (GtkButton *btn, gpointer user_data) { NTSTATUS status; struct epm_Lookup r; @@ -151,7 +150,7 @@ static void on_select_target_clicked(GtkButton *btn, gpointer user_data) struct dcerpc_binding *bd; gint result; - d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(FALSE, NULL)); + d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(TRUE, NULL)); result = gtk_dialog_run(GTK_DIALOG(d)); switch(result) { case GTK_RESPONSE_ACCEPT: |