From d8f94f6d9846ea7df3f7c605cb539e75ff407875 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 22 Aug 2011 18:22:35 +0000 Subject: [PATCH] fix for defect 3392944 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10338 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/db2install | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/db2install b/xCAT/postscripts/db2install index 2721ec3aa..ce2a5da67 100755 --- a/xCAT/postscripts/db2install +++ b/xCAT/postscripts/db2install @@ -19,6 +19,7 @@ Needs export MASTER=site.master export DB2INSTALLLOC=site.db2installlloc export DATABASELOC=site.databaseloc + export INSTALLDIR=site.installdir export XCATDPORT=site.xcatdport export NODE= @@ -74,6 +75,18 @@ chomp $::hname; $::MN = $ENV{'MASTER'}; # as known by the node $::databaseloc = $ENV{'DATABASELOC'}; # directory for db instance +my $installdir = $ENV{'INSTALLDIR'}; # installdir + +# check to see if the databaseloc attribute is in the installdir attribute +# directory path. If it is error out and send something to syslog +my @installlocdir = split '/', $installdir; # get base of installdir +my @dblocdir = split '/',$::databaseloc; # get base of database +if ($installlocdir[1] eq $dblocdir[1] ) { # if they match,error + my $msg="db2install:The site databaseloc attribute is set to the directory or a sub-directory of the site table installloc or installdir attribute or the default of /install. This is not a supported configuration."; + `logger -t xcat $msg`; + exit(1); +} + if ($::osname eq 'AIX') { $::installdb2dir = "/opt/IBM/db2/V9.7"; # default @@ -89,7 +102,7 @@ my $msg; my $db2install = $::installdb2dir; $db2install .= "\/instance"; if (!(-e ($db2install))) -{ # already installed +{ # not already installed $::db2installloc = $ENV{'DB2INSTALLLOC'}; if (!$::db2installloc) {