Browse Source

This completes the NSS PAM interface, they both can be turned off or on via

the Yard Box now.
master
freesource 23 years ago
parent
commit
1791729abd
  1. 18
      BootRoot/Yard.pm
  2. 54
      BootRoot/YardBox.pm

18
BootRoot/Yard.pm

@ -486,13 +486,17 @@ sub read_contents_file {
# Uses include_file
sub extra_links {
my ($contents_file) = @_;
my ($contents_file, $nss_pam) = @_;
#info(0, "PASS 2: Picking up extra files from links, and finding pam and nss service modules...\n");
info(0, "PASS 2: Picking up extra files from links...\n");
# First we find nss and pam stuff if asked for.
my $find_nss = $nss_pam->{60}{conf_nss};
my $find_pam = $nss_pam->{61}{conf_pam};
if ( $find_nss == 1 || $find_pam == 1 ) {
for my $file (keys %Included) {
@ -502,9 +506,10 @@ sub extra_links {
## Here's where some cool stuff happens
## This can be turned on/off from the YardBox
## pam service modules are check for dependencies,
## mostly this translates into libnsl.
## mostly this translates into libnsl. --freesource
## NSS --freesource
## NSS
if ( $find_nss == 1 ) {
if ( $file =~ m,/nsswitch.conf, ) {
my @nss_libs = find_nss($file);
@ -513,8 +518,10 @@ sub extra_links {
}
}
}
## PAM
if ( $find_pam == 1 ) {
if ( $file =~ m,/pam\.conf|/pam\.d/, ) {
my @pam_libs = find_pam($file);
@ -523,9 +530,12 @@ sub extra_links {
}
}
}
} # for loop
} # end for nss pam
info(0,"\n");
for my $file (keys %Included) {

54
BootRoot/YardBox.pm

@ -143,11 +143,13 @@ my @menu_items = ( { path => '/File',
{ path => '/Edit/Settings/settings_separator',
type => '<Separator>' },
{ path => '/Edit/Settings/NSS Config',
action => "1111",
type => '<CheckItem>' },
action => "60",
type => '<CheckItem>',
callback => \&nss_pam },
{ path => '/Edit/Settings/PAM Config',
action => '1112',
type => '<CheckItem>' },
action => '61',
type => '<CheckItem>',
callback => \&nss_pam },
{ path => '/Edit/Stages/' },
{ path => '/Edit/Stages/one-by-one',
@ -602,9 +604,38 @@ sub check {
}
############
# NSS PAM #
############
my %nss_pam = (
60 => {
conf_nss => 1,
},
61 => {
conf_pam => 1,
},
);
sub nss_pam {
my ($widget,$action) = @_;
my @label = keys( % { $nss_pam{$action} } );
# off
if ($nss_pam{$action}{$label[0]} == 1) {
$nss_pam{$action}{$label[0]} = 0;
}
# on
else {
$nss_pam{$action}{$label[0]} = 1;
}
}
sub links_deps {
my $error = extra_links($changed_text);
my $error = extra_links($changed_text, \%nss_pam);
return if $error && $error eq "ERROR";
$error = hard_links();
@ -703,6 +734,7 @@ sub test {
return if $error && $error eq "ERROR";
}
#########################
# CHECK STAGE VARIABLES #
#########################
@ -856,7 +888,11 @@ sub yard_box {
# 34 test_passwd 1 (default) 0
# 35 test_pam 1 (default) 0
# 36 test_nss 1 (default) 0
#
# NSS PAM Conf <CheckItem> HOH = %nss_pam
# -----------------------------------------
# 60 conf_nss 1 (default) 0
# 61 conf_nss 1 (default) 0
# Stages
$one_by_one = $item_factory->get_item('/Edit/Stages/one-by-one');
@ -992,6 +1028,12 @@ sub yard_box {
my $test_nss = $item_factory->get_item('/Tests/nss');
$test_nss->active(1);
# PAM NSS Conf
my $conf_nss = $item_factory->get_item('/Edit/Settings/NSS Config');
$conf_nss->active(1);
my $conf_pam = $item_factory->get_item('/Edit/Settings/PAM Config');
$conf_pam->active(1);
#_______________________________________
# Create the GtkText widget
$text = new Gtk::Text( undef, undef );

Loading…
Cancel
Save