summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive_gtk.pm
Commit message (Expand)AuthorAgeFilesLines
* fear the shaped windows...damien2001-09-111-2/+2
* - make diskdrake work in embedded modePascal Rigaux2001-09-101-9/+9
* clicked_may_quit used in place of clicked+exception to work-around perl-GTK b...Pascal Rigaux2001-09-091-1/+4
* embedded mode fixYves Duret2001-09-041-0/+1
* better sizing for combo boxesPascal Rigaux2001-09-031-2/+7
* corrected wizard mode display height/widthdamien2001-08-301-1/+1
* fix&cleanup window sizePascal Rigaux2001-08-301-2/+3
* more intelligent setting back the selected value in the clist and ctreePascal Rigaux2001-08-221-2/+3
* - fix entries editing causing the cursor to go to the end of linePascal Rigaux2001-08-221-1/+3
* (wait_message_nextW): fix previous text == new text causing noPascal Rigaux2001-08-201-2/+2
* (create_ctree): fix focusing (the assumption number of leaves = number of lin...Pascal Rigaux2001-08-191-3/+3
* fix bug in box's height usePascal Rigaux2001-08-181-1/+1
* better radiobox keyboard handlingPascal Rigaux2001-08-181-14/+31
* big renaming of ask_from_entries_refH in ask_from and ask_from_entries_refH_p...Pascal Rigaux2001-08-181-1/+1
* enhance look, fix ask_fileWPascal Rigaux2001-08-181-13/+26
* no scrollbar if list <= 10 and the list is alonedamien2001-08-171-1/+1
* - small fixes (esp. gtk sensitive handling)Pascal Rigaux2001-08-141-2/+8
* clean the nice till fixPascal Rigaux2001-08-121-9/+4
* When a dialog has too many widgets use a scrollbar so that the dialog does no...Till Kamppeter2001-08-121-2/+5
* Fixed bug of input fields with a number as default input not allowing to ente...Till Kamppeter2001-08-121-1/+6
* cleanup, functions already defined in interactivePascal Rigaux2001-08-061-3/+0
* corrected gtkradio : shift instead of popdamien2001-08-061-1/+1
* (ask_browse_tree_info_refW): s/wait_msg/wait_message/ (wait_msg doesn'tPascal Rigaux2001-08-041-1/+1
* allow ask_browse_tree_info_refW to return 0 on cancel (previously always 1).Francois Pons2001-07-271-1/+1
* added a before leaving code to clean added reference (else it seems to bahaveFrancois Pons2001-07-271-0/+9
* fixed wrong reference to added icons to ask_browse_tree_info_refW.Francois Pons2001-07-271-4/+5
* move to MDK::Common, bool->to_boolPascal Rigaux2001-07-241-1/+1
* merging common code for individual package selection and service to createFrancois Pons2001-07-121-0/+190
* (exit): fix the exit codePascal Rigaux2001-04-141-1/+1
* (ask_from_entries_refW): set_default_size width 250Pascal Rigaux2001-04-131-1/+1
* use gtkset_tip (so that no tip is set when tip eq '')Pascal Rigaux2001-04-101-9/+11
* (create_ctree): handle single click on node opens the nodePascal Rigaux2001-04-101-11/+17
* don't crash if wizard. pixel's faultdamien2001-03-291-1/+1
* better default_size settingPascal Rigaux2001-03-281-1/+1
* corrected pixel shit if embeddeddamien2001-03-281-1/+1
* try to fix displaying in draksecPascal Rigaux2001-03-271-7/+9
* (ask_from_entries_refW): better sizing in case of scrollsPascal Rigaux2001-03-191-2/+4
* - cleanup double click stuffPascal Rigaux2001-03-131-12/+18
* (ask_from_entries_refW): add $set for "label" entriesPascal Rigaux2001-03-121-0/+1
* add "label" typePascal Rigaux2001-03-121-0/+2
* added tooltips to create_boxradiodamien2001-03-091-0/+6
* applied gtkradiodamien2001-03-091-2/+26
* if wizard, show the buttondamien2001-02-261-1/+1
* (ask_from_entries_refW): ensure "advanced" lists center the chosen valuePascal Rigaux2001-02-251-2/+2
* (ask_from_entries_refW): double clicking on list means 'Ok'Pascal Rigaux2001-02-231-0/+4
* (ask_from_entries_refW): if no button wanted, don't call create_okcancelPascal Rigaux2001-02-221-1/+2
* major move. now ask_from_list returns false when canceled (it doesn't die 'as...Pascal Rigaux2001-02-201-0/+4
* added png support. Need to test the faces2xpm stuff.damien2001-02-151-2/+2
* (ask_from_entries_refW): use $common->{advanced_label}Mystery Man 5532001-02-121-22/+72
* button behaviour now chosen, and implementedPascal Rigaux2001-02-101-6/+8
span>$kind eq 'LDAP') { my $domain = $netc->{LDAPDOMAIN} || do { my $s = run_program::rooted_get_stdout($::prefix, 'ldapsearch', '-x', '-h', $val, '-b', '', '-s', 'base', '+'); first($s =~ /namingContexts: (.+)/); } or log::l("no ldap domain found on server $val"), return; $in->do_pkgs->install(qw(openldap-clients nss_ldap pam_ldap autofs)); set_nsswitch_priority('ldap'); set_pam_authentication('ldap'); set_ldap_conf($domain, $val, 1); } elsif ($kind eq 'NIS') { $in->do_pkgs->install('ypbind'); my $domain = $netc->{NISDOMAIN}; $domain || $val ne "broadcast" or die \N("Can't use broadcast with no NIS domain"); my $t = $domain ? "domain $domain" . ($val ne "broadcast" && " server") : "ypserver"; substInFile { $_ = "#~$_" unless /^#/; $_ .= "$t $val\n" if eof; } "$::prefix/etc/yp.conf"; set_nsswitch_priority('nis'); #- no need to modify system-auth for nis $when_network_is_up->(sub { run_program::rooted($::prefix, 'nisdomainname', $domain); run_program::rooted($::prefix, 'service', 'ypbind', 'restart'); }) if !$::isInstall; #- TODO: also do it during install since nis can be useful to resolve domain names. Not done because 9.2-RC } elsif ($kind eq 'winbind') { my $domain = $netc->{WINDOMAIN}; $domain =~ tr/a-z/A-Z/; $in->do_pkgs->install(qw(samba-winbind samba-common)); set_pam_authentication('winbind'); require network::smb; network::smb::write_smb_conf($domain); run_program::rooted($::prefix, "chkconfig", "--level", "35", "winbind", "on"); mkdir_p("$::prefix/home/$domain"); #- defer running smbpassword until the network is up $when_network_is_up->(sub { run_program::rooted($::prefix, 'smbpasswd', '-j', $domain, '-U', $val . '%' . $authentication->{winpass}); }); } } sub pam_modules() { 'pam_ldap', 'pam_winbind', 'pam_mkhomedir'; } sub pam_module_from_path { $_[0] && $_[0] =~ m|/lib/security/(pam_.*)\.so| && $1; } sub pam_module_to_path { "/lib/security/$_[0].so"; } sub pam_format_line { my ($type, $control, $module, @para) = @_; sprintf("%-11s %-13s %s\n", $type, $control, join(' ', pam_module_to_path($module), @para)); } sub get_raw_pam_authentication() { my %before_deny; foreach (cat_("$::prefix/etc/pam.d/system-auth")) { my ($type, $control, $module, @para) = split; if ($module = pam_module_from_path($module)) { $before_deny{$type}{$module} = \@para if $control eq 'sufficient' && member($module, pam_modules()); } } \%before_deny; } sub set_raw_pam_authentication { my ($before_deny, $before_first) = @_; substInFile { my ($type, $control, $module, @para) = split; my $added_pre_line = ''; if ($module = pam_module_from_path($module)) { if ($module eq 'pam_unix' && member($type, 'auth', 'account')) { #- ensure use_first_pass option is there $_ = pam_format_line($type, 'sufficient', $module, uniq(@para, 'use_first_pass')); if ($control eq 'required') { #- ensure a pam_deny line is there ($control, $module, @para) = ('required', 'pam_deny'); ($added_pre_line, $_) = ($_, pam_format_line($type, $control, $module)); } } if (member($module, pam_modules())) { #- first removing previous config warn "dropping line $_"; $_ = ''; } else { if ($before_first->{$type}) { foreach my $module (keys %{$before_first->{$type}}) { $_ = pam_format_line($type, 'required', $module, @{$before_first->{$type}{$module}}) . $_; } delete $before_first->{$type}; } if ($control eq 'required' && $module eq 'pam_deny') { if ($before_deny->{$type}) { foreach my $module (keys %{$before_deny->{$type}}) { $_ = pam_format_line($type, 'sufficient', $module, @{$before_deny->{$type}{$module}}) . $_; } } } } $_ = $added_pre_line . $_; } } "$::prefix/etc/pam.d/system-auth"; } sub get_pam_authentication_kinds() { my $before_deny = get_raw_pam_authentication(); map { s/pam_//; $_ } keys %{$before_deny->{auth}}; } sub set_pam_authentication { my (@authentication_kinds) = @_; my $before_deny = {}; my $before_first = {}; foreach (@authentication_kinds) { my $module = 'pam_' . $_; $before_deny->{auth}{$module} = []; $before_deny->{account}{$module} = []; $before_deny->{password}{$module} = [] if $_ eq 'ldap'; $before_first->{session}{pam_mkhomedir} = [ 'skel=/etc/skel/', 'umask=0022' ] if $_ eq 'winbind'; } set_raw_pam_authentication($before_deny, $before_first); } sub set_nsswitch_priority { my (@kinds) = @_; # allowed: files nis ldap dns substInFile { if (my ($database, $l) = /^(\s*(?:passwd|shadow|group|automount):\s*)(.*)/) { $_ = $database . join(' ', uniq('files', @kinds, split(' ', $l))) . "\n"; } } "$::prefix/etc/nsswitch.conf"; } sub read_ldap_conf() { my %conf = map { s/^\s*#.*//; if_(/(\S+)\s+(.*)/, $1 => $2) } cat_("$::prefix/etc/ldap.conf"); \%conf; } sub set_ldap_conf { my ($domain, $servers, $b_ssl) = @_; my %wanted_conf = ( host => $servers, base => $domain, port => $b_ssl ? 636 : 389, ssl => $b_ssl ? 'on' : 'off', nss_base_shadow => "ou=People,$domain", nss_base_passwd => "ou=People,$domain", nss_base_group => "ou=Group,$domain", ); substInFile { my ($cmd) = /^#?\s*(\w+)\s/; if ($cmd && exists $wanted_conf{$cmd}) { my $val = $wanted_conf{$cmd}; $wanted_conf{$cmd} = ''; $_ = $val ? "$cmd $val\n" : ''; } } "$::prefix/etc/ldap.conf"; } 1;