1
0
mirror of https://github.com/fspc/gbootroot.git synced 2025-02-23 09:03:23 -05:00

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

the Yard Box now.
This commit is contained in:
freesource 2001-11-29 04:24:46 +00:00
parent ff44ae48f5
commit 1791729abd
2 changed files with 80 additions and 28 deletions

View File

@ -486,45 +486,55 @@ 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};
for my $file (keys %Included) {
if ( $find_nss == 1 || $find_pam == 1 ) {
##### Use replacement file if specified
$file = $replaced_by{$file} if defined($replaced_by{$file});
for my $file (keys %Included) {
## 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.
##### Use replacement file if specified
$file = $replaced_by{$file} if defined($replaced_by{$file});
## NSS --freesource
if ( $file =~ m,/nsswitch.conf, ) {
## 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. --freesource
my @nss_libs = find_nss($file);
foreach ( @nss_libs ) {
$Included{$_} = 1; # adding on the run
## NSS
if ( $find_nss == 1 ) {
if ( $file =~ m,/nsswitch.conf, ) {
my @nss_libs = find_nss($file);
foreach ( @nss_libs ) {
$Included{$_} = 1; # adding on the run
}
}
}
}
## PAM
if ( $find_pam == 1 ) {
if ( $file =~ m,/pam\.conf|/pam\.d/, ) {
## PAM
if ( $file =~ m,/pam\.conf|/pam\.d/, ) {
my @pam_libs = find_pam($file);
foreach ( @pam_libs ) {
$Included{$_} = 1; # adding on the run
}
my @pam_libs = find_pam($file);
foreach ( @pam_libs ) {
$Included{$_} = 1; # adding on the run
}
}
}
} # for loop
}
} # end for nss pam
info(0,"\n");

View File

@ -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 );
@ -1807,7 +1849,7 @@ Selection Shortcuts
Searching Shortcuts
Alt-S Search Template
Alt-S Search Template
File Shortcuts