--- gcmd-1-3.orig/src/gnome-smb-auth.c 1970-01-01 01:00:00.000000000 +0100 +++ gcmd-1-3.new/src/gnome-smb-auth.c 2007-02-05 09:48:41.000000000 +0100 @@ -0,0 +1,53 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ +#include +#include +// #include +#include + + +void /* GnomeVFSModuleCallback */ +vfs_full_authentication_callback (const GnomeVFSModuleCallbackFullAuthenticationIn *in_args, size_t in_size, + GnomeVFSModuleCallbackFullAuthenticationOut *out_args, size_t out_size, + gpointer user_data) +{ + static int counter = 0; + // static GnomePasswordDialogRemember remember; + gboolean canc = FALSE; + static char *username; + static char *password; + static char *domain; + static GtkWidget *gpwd = NULL; + gpwd = GNOME_PASSWORD_DIALOG (gnome_password_dialog_new ("Enter password", + "Problem: access not permitted\n\n please supply user credentials\n\nRemember: wrong credentials may lead to account locking", + "", + "",FALSE)); + gnome_password_dialog_set_show_domain(gpwd, in_args->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_DOMAIN); + gnome_password_dialog_set_domain (gpwd, in_args->domain ); + gnome_password_dialog_set_show_remember (gpwd, FALSE); + gnome_password_dialog_set_show_username (gpwd, in_args->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_USERNAME); + gnome_password_dialog_set_username (gpwd, in_args->username ); + gnome_password_dialog_set_show_userpass_buttons (gpwd, in_args->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_ANON_SUPPORTED); + gnome_password_dialog_set_show_password (gpwd, in_args->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_PASSWORD); + canc = gnome_password_dialog_run_and_block (GNOME_PASSWORD_DIALOG (gpwd)); + username = gnome_password_dialog_get_username (gpwd); + password = gnome_password_dialog_get_password (gpwd); + domain = gnome_password_dialog_get_domain (gpwd); + if (!canc) { + out_args->abort_auth = TRUE; + } else { + out_args->username = g_strdup ( username ); + out_args->password = g_strdup ( password ); + out_args->domain = g_strdup ( domain ); + } + if ( counter == 2 ) { + counter = 0 ; + out_args->abort_auth = TRUE; + } + counter ++; +/* + g_free (username); + g_free (password); + g_free (domain); +*/ +} + --- gcmd-1-3.orig/src/gnome-smb-auth.h 1970-01-01 01:00:00.000000000 +0100 +++ gcmd-1-3.new/src/gnome-smb-auth.h 2007-02-05 09:48:41.000000000 +0100 @@ -0,0 +1,18 @@ + +#ifndef __GNOME_AUTH_H__ +#define __GNOME_AUTH_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + + +void vfs_full_authentication_callback (const GnomeVFSModuleCallbackFullAuthenticationIn *in_args, size_t in_size, GnomeVFSModuleCallbackFullAuthenticationOut *out_args, size_t out_size, gpointer user_data); + + +G_END_DECLS + +#endif // __GNOME_AUTH_H__ --- gcmd-1-3.orig/src/main.c 2007-02-05 08:01:40.000000000 +0100 +++ gcmd-1-3.new/src/main.c 2007-02-05 09:48:41.000000000 +0100 @@ -33,6 +33,8 @@ #include "tags/gnome-cmd-tags.h" +#include "gnome-smb-auth.h" + GnomeCmdMainWin *main_win; GtkWidget *main_win_widget; gchar *start_dir_left; @@ -110,6 +112,10 @@ ls_colors_init (); gdk_rgb_init (); gnome_vfs_init (); + gnome_vfs_module_callback_set_default (GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION, + vfs_full_authentication_callback, + GINT_TO_POINTER (0), + NULL); conf_dir = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir(), ".gnome-commander", NULL); create_dir_if_needed (conf_dir); g_free (conf_dir); --- gcmd-1-3.orig/src/Makefile.in 2007-02-05 14:29:38.000000000 +0100 +++ gcmd-1-3.new/src/Makefile.in 2007-02-05 10:16:57.000000000 +0100 @@ -108,7 +108,7 @@ gnome-cmd-xfer-progress-win.h gnome-cmd-xfer-progress-win.c \ gnome-cmd-xfer.h gnome-cmd-xfer.c handle.h handle.c history.h \ history.c imageloader.c imageloader.h ls_colors.h ls_colors.c \ - main.c owner.h owner.c plugin_manager.h plugin_manager.c \ + gnome-smb-auth.c gnome-smb-auth.h main.c owner.h owner.c plugin_manager.h plugin_manager.c \ useractions.h useractions.c utils.h utils.c widget-factory.h \ widget-factory.c gnome-cmd-python-plugin.h \ gnome-cmd-python-plugin.c @@ -149,7 +149,7 @@ gnome-cmd-smb-path.$(OBJEXT) gnome-cmd-style.$(OBJEXT) \ gnome-cmd-xfer-progress-win.$(OBJEXT) gnome-cmd-xfer.$(OBJEXT) \ handle.$(OBJEXT) history.$(OBJEXT) imageloader.$(OBJEXT) \ - ls_colors.$(OBJEXT) main.$(OBJEXT) owner.$(OBJEXT) \ + ls_colors.$(OBJEXT) gnome-smb-auth.$(OBJEXT) main.$(OBJEXT) owner.$(OBJEXT) \ plugin_manager.$(OBJEXT) useractions.$(OBJEXT) utils.$(OBJEXT) \ widget-factory.$(OBJEXT) $(am__objects_1) gnome_commander_OBJECTS = $(am_gnome_commander_OBJECTS) @@ -465,7 +465,7 @@ gnome-cmd-xfer-progress-win.h gnome-cmd-xfer-progress-win.c \ gnome-cmd-xfer.h gnome-cmd-xfer.c handle.h handle.c history.h \ history.c imageloader.c imageloader.h ls_colors.h ls_colors.c \ - main.c owner.h owner.c plugin_manager.h plugin_manager.c \ + gnome-smb-auth.c gnome-smb-auth.h main.c owner.h owner.c plugin_manager.h plugin_manager.c \ useractions.h useractions.c utils.h utils.c widget-factory.h \ widget-factory.c $(am__append_1) gnome_commander_LDADD = \