diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-06-28 21:15:04 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-06-28 21:15:04 +0000 |
commit | 4026ee6b73851ac1dc2c9a77c85f6c3138456c5b (patch) | |
tree | ef3ba91d1153c23f331b033fe763f484fdfc3f6f /perl-install/diskdrake/smbnfs_gtk.pm | |
parent | 8ca92b87576d9aa7e98654186fcac7855fdec530 (diff) | |
download | drakx-4026ee6b73851ac1dc2c9a77c85f6c3138456c5b.tar drakx-4026ee6b73851ac1dc2c9a77c85f6c3138456c5b.tar.gz drakx-4026ee6b73851ac1dc2c9a77c85f6c3138456c5b.tar.bz2 drakx-4026ee6b73851ac1dc2c9a77c85f6c3138456c5b.tar.xz drakx-4026ee6b73851ac1dc2c9a77c85f6c3138456c5b.zip |
- add authentification in diskdrake --smb (esp. for windows NT)
- use "credentials=" to put the passwords
(ideas and investigations from Stew Benedict,
integrated by Pixel, but need testing)
Known bug: if you want to change the password when there are 2 entries in fstab
using the same username=/password=, writing the credentials is done in random order,
=> you've got one chance in 2 that the password is changed :-(
Diffstat (limited to 'perl-install/diskdrake/smbnfs_gtk.pm')
-rw-r--r-- | perl-install/diskdrake/smbnfs_gtk.pm | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/perl-install/diskdrake/smbnfs_gtk.pm b/perl-install/diskdrake/smbnfs_gtk.pm index e8519615b..e4cf415ed 100644 --- a/perl-install/diskdrake/smbnfs_gtk.pm +++ b/perl-install/diskdrake/smbnfs_gtk.pm @@ -151,10 +151,43 @@ sub import_ctree { }; }; + my $find_exports; $find_exports = sub { + my ($server) = @_; + my @l = eval { $kind->find_exports($server) }; + return @l if !$@; + + if ($server->{username}) { + $in->ask_warn('', _("Can't login using username %s (bad password?)", $server->{username})); + network::smb::remove_bad_credentials($server); + } else { + if (my @l = network::smb::authentifications_available($server)) { + my $user = $in->ask_from_list_(_("Domain Authentication Required"), + _("Which username"), [ @l, __("Another one") ]) or return; + if ($user ne 'Another one') { + network::smb::read_credentials($server, $user); + goto $find_exports; + } + } + } + + if ($in->ask_from(_("Domain Authentication Required"), + _("Please enter your username, password and domain name to access this host."), + [ + { label => _("Username"), val => \$server->{username} }, + { label => _("Password"), val => \$server->{password} }, + { label => _("Domain"), val => \$server->{domain} }, + ])) { + goto $find_exports; + } else { + delete $server->{username}; + (); + } + }; + my $add_exports = sub { my ($node) = @_; $tree->expand($node); - foreach ($kind->find_exports($wservers{$node->{_gtk}} || return)) { #- can't die here since insert_node provoque a tree_select_row before the %wservers is filled + foreach ($find_exports->($wservers{$node->{_gtk}} || return)) { #- can't die here since insert_node provoque a tree_select_row before the %wservers is filled my $w = $tree->insert_node($node, undef, [$kind->to_string($_)], 5, (undef) x 4, 1, 0); set_export_icon(find_fstab_entry($kind, $_), $w); $wexports{$w->{_gtk}} = $_; @@ -187,9 +220,7 @@ sub import_ctree { if (!$curr->row->children) { gtkset_mousecursor_wait($tree->window); my_gtk::flush(); - $tree->freeze; $add_exports->($curr); - $tree->thaw; gtkset_mousecursor_normal($tree->window); } $current_entry = undef; |