summaryrefslogtreecommitdiffstats
path: root/src/os-plugins/plugins/auth/OpenSLX/OSPlugin/auth.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/os-plugins/plugins/auth/OpenSLX/OSPlugin/auth.pm')
-rw-r--r--src/os-plugins/plugins/auth/OpenSLX/OSPlugin/auth.pm92
1 files changed, 78 insertions, 14 deletions
diff --git a/src/os-plugins/plugins/auth/OpenSLX/OSPlugin/auth.pm b/src/os-plugins/plugins/auth/OpenSLX/OSPlugin/auth.pm
index fdb48ebc..939223f1 100644
--- a/src/os-plugins/plugins/auth/OpenSLX/OSPlugin/auth.pm
+++ b/src/os-plugins/plugins/auth/OpenSLX/OSPlugin/auth.pm
@@ -289,12 +289,13 @@ sub installationPhase
my $nfs4 = $self->{attrs}->{'auth::nfs4'};
my $passwd = $self->{attrs}->{'auth::passwd'};
my $krb = $self->{attrs}->{'auth::krb'};
+ my $distro = (split('-',$self->{'os-plugin-engine'}->distroName()))[0];
# configure passwd
if($passwd) {
my $rootPwd = $self->{attrs}->{'auth::rootpwd'};
if($rootPwd eq "") {
- print "root-password not set. Change auth::rootpwd and retry.\n";
+ print "* root-password not set. Change auth::rootpwd and retry.\n";
exit 1;
}
@@ -303,32 +304,95 @@ sub installationPhase
);
}
+
# configure ldap
if ($ldap) {
if ($self->{attrs}->{'auth::ldapuri'} eq '' ||
$self->{attrs}->{'auth::ldapbase'} eq '') {
- print "auth::ldapuri and/or auth::ldapbase not defined. LDAP configuration canceld\n";
+ print "* auth::ldapuri and/or auth::ldapbase not defined. LDAP configuration canceld\n";
exit 1;
}
-
+ if ($distro eq 'ubuntu' && ! -d "/usr/share/doc/libpam-ldap") {
+ if (! -d "/usr/share/doc/libpam-ldapd") {
+ # ubuntu 10.04 && 11.04
+ print "* libpam-ldapd or libpam-ldap not installed but required.\n";
+ print " libpam-ldap is preferred over libpam-ldapd!\n";
+ print " Please install one of these packages and try again!\n";
+ exit 1;
+ }
+ print "* libpam-ldapd installed but not recommended. If there are problems, be aware about\n";
+ print " /etc/nslcd.conf which can differ from /etc/pam.conf syntax!\n";
+ print " /etc/nslcd.conf can also be copied via auth::files\n";
+ }
+ if ($distro eq 'suse' && ! -d "/usr/share/doc/packages/pam_ldap") {
+ if (! -d "/usr/share/doc/packages/nss-pam-ldapd") {
+ # suse 10.4
+ print "* pam_ldap or nss-pam-ldapd not installed but required.\n";
+ print " pam_ldap is preferred over nss-pam-ldapd!\n";
+ print " Please install one of these packages and try again!\n";
+ exit 1;
+ }
+ print "* nss-pam-ldapd installed but not recommended. If there are problems, be aware about\n";
+ print " /etc/nslcd.conf which can differ from /etc/pam.conf syntax!\n";
+ print " /etc/nslcd.conf can also be copied via auth::files\n";
+ }
$self->_writeLdapConf(); #write ldap.conf
}
# configure automount
if ($automount) {
if ($self->{attrs}->{'auth::automnt_src'} eq '' && $self->{attrs}->{'auth::automnt_script'} eq '') {
- print "auth::automnt_src and auth::automnt_script not defined. Automount configuration canceld\n";
+ print "* auth::automnt_src and auth::automnt_script not defined. Automount configuration canceld\n";
exit 1;
}
if ($self->{attrs}->{'auth::automnt_dir'} eq '') {
- print "auth::automnt_dir not defined. Automount configuration canceld\n";
+ print "* auth::automnt_dir not defined. Automount configuration canceld\n";
exit 1;
}
+ if ($distro eq 'ubuntu') {
+ #both package names: ubuntu 10.04&11.04
+ if ( ! -d "/usr/share/doc/nfs-common") {
+ print "* Package nfs-common not installed, but is required.\n";
+ print " Please install first.\n";
+ exit 1;
+ }
+ if (! -d "/usr/share/doc/autofs5") {
+ print "* Package autofs/autofs5 not installed, but are required.\n";
+ print " Please install first.\n";
+ exit 1;
+ }
+ }
+ if ($distro eq 'suse') {
+ if (! -f "/etc/init.d/nfs") {
+ # suse 11.4 (no ../doc file, but testable through init.d file)
+ print "* Package nfs-client not installed, but are required.\n";
+ print " Please install first.\n";
+ exit 1;
+ }
+ if (! -d "/usr/share/doc/packages/autofs") {
+ # suse 11.4
+ print "* Package autofs not installed, but are required.\n";
+ print " Please install first.\n";
+ exit 1;
+ }
+ }
$self->_writeAutomountConf();
}
# configure kerberOS. Biggest part in preInstallationPhase()!
if ($krb) {
+ if ($distro eq 'ubuntu' && ! -d "/usr/share/doc/libpam-krb5") {
+ #ubuntu 11.04&10.04
+ print "* Package libpam-krb5 not installed but required.\n";
+ print " Please install first!\n";
+ exit 1;
+ }
+ if ($distro eq 'suse' && ! -d "/usr/share/doc/packages/pam_krb5") {
+ #ubuntu 11.04&10.04
+ print "* Package pam_krb5 not installed but required.\n";
+ print " Please install first!\n";
+ exit 1;
+ }
$self->_krbConf();
}
@@ -373,19 +437,19 @@ sub preInstallationPhase()
my $automntScript = $self->{attrs}->{'auth::automnt_script'};
if ($krb && !-d $files) {
- print "KerberOS enabled, but path $files from auth::files not found. Configuration canceld.\n";
+ print "* KerberOS enabled, but path $files from auth::files not found. Configuration canceld.\n";
exit 1;
}
if ($krb && ! -e "$files/krb5.conf") {
- print "KerberOS enabled, but needed Configfile $files/krb5.conf not found. Installation stopped.\n";
+ print "* KerberOS enabled, but needed Configfile $files/krb5.conf not found. Installation stopped.\n";
exit 1;
}
if ($krb && $krbScript ne '' && ! -e "$files/$krbScript") {
- print "KerberOS enabled, but needed Configfile $files/$krbScript not found. Installation stopped.\n";
+ print "* KerberOS enabled, but needed Configfile $files/$krbScript not found. Installation stopped.\n";
exit 1;
}
if ($autoMount && $automntScript ne '' && ! -e "$files/$automntScript") {
- print "auth::automnt_script $files/$automntScript not found. Installation stopped.\n";
+ print "* auth::automnt_script $files/$automntScript not found. Installation stopped.\n";
exit 1;
}
@@ -516,14 +580,14 @@ sub _writeAutomountConf
my $autoConf;
if ($automntSrc ne '' && $automntScript ne '') {
- print "auth::automnt_src and auth::automnt_script enabled. Both won't work together.";
- print "You need to disable (set the value to '' (empty) one of them!";
- print "Automount configuration failed.";
+ print "* auth::automnt_src and auth::automnt_script enabled. Both won't work together.";
+ print " You need to disable (set the value to '' (empty) one of them!";
+ print " Automount configuration failed.";
exit 1;
}
# nfs
- if ($autoProto eq 'nfs') {
+ if ($autoProto eq 'nfs' && ! $nfs4) {
my $autoConf = "# created by auth-Plugin\n";
$autoConf .= "* -fstype=nfs,rsize=32768,wsize=32768,rw $autoHost:$autoSrcPath/&\n";
spitFile("$self->{'pluginRepositoryPath'}/auto.slx", $autoConf);
@@ -541,7 +605,7 @@ sub _writeAutomountConf
$autoConf .= "# not used, because we use auth::authmnt_script\n";
spitFile("$self->{'pluginRepositoryPath'}/auto.slx", $autoConf);
} else {
- print "Automount Configuration failed. Unknown protocol in auth::automnt_src, auth::nfs4 or auth::idmap_domain not enabled.\n";
+ print "* Automount Configuration failed. Unknown protocol in auth::automnt_src or auth::nfs4 and auth::idmap_domain not enabled.\n";
exit 1;
}