projects/oracle-server-scripts/create-db.sh | 3 ++-
projects/oracle-server-scripts/embedded-createdb.tmpl | 13 -------------
projects/oracle-server-scripts/embedded-upgradedb-10g.tmpl | 1 -
projects/oracle-server-scripts/embedded-upgradedb.tmpl | 1 -
projects/oracle-server-scripts/oracle-server-scripts.spec | 5 ++++-
rel-eng/packages/oracle-server-scripts | 2 +-
spacewalk/setup/share/oracle/upgrade-db.sh | 5 +++--
7 files changed, 10 insertions(+), 20 deletions(-)
New commits:
commit 2e92bd199e8d807ee64524495a57f8f24d00796d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Mar 30 16:11:54 2011 +0200
Automatic commit of package [oracle-server-scripts] release [10.2.0.54-1].
diff --git a/projects/oracle-server-scripts/oracle-server-scripts.spec b/projects/oracle-server-scripts/oracle-server-scripts.spec
index a63c23d..3cdcf9a 100644
--- a/projects/oracle-server-scripts/oracle-server-scripts.spec
+++ b/projects/oracle-server-scripts/oracle-server-scripts.spec
@@ -8,7 +8,7 @@
Summary: Oracle 10g Database Server Enterprise Edition scripts
Name: oracle-server-scripts
-Version: 10.2.0.53
+Version: 10.2.0.54
Release: 1%{?dist}
Source0: oracle-home.sh
Source1: init-params.ora
@@ -100,6 +100,9 @@ exit 0
%{oracle_scripts}
%changelog
+* Wed Mar 30 2011 Michael Mraka <michael.mraka(a)redhat.com> 10.2.0.54-1
+- oracle_sqlplus_t is not able to write to logs
+
* Tue Mar 22 2011 Michael Mraka <michael.mraka(a)redhat.com> 10.2.0.53-1
- new m4 (1.4.13-5) insists on having defines before template
diff --git a/rel-eng/packages/oracle-server-scripts b/rel-eng/packages/oracle-server-scripts
index 80412b1..c04f74d 100644
--- a/rel-eng/packages/oracle-server-scripts
+++ b/rel-eng/packages/oracle-server-scripts
@@ -1 +1 @@
-10.2.0.53-1 projects/oracle-server-scripts/
+10.2.0.54-1 projects/oracle-server-scripts/
commit 92688d1930b4da0dc9bf60159b7752f13b6b2e13
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Mar 30 16:05:04 2011 +0200
oracle_sqlplus_t is not able to write to logs
fixing
type=AVC msg=audit(1301493420.034:1814): avc: denied { write } for
pid=11246 comm="sqlplus"
path="/rhnsat/admin/rhnsat/logs/create_rhnsat.log" dev=dm-0 ino=917523
scontext=unconfined_u:unconfined_r:oracle_sqlplus_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:oracle_common_log_t:s0 tclass=file
diff --git a/projects/oracle-server-scripts/create-db.sh b/projects/oracle-server-scripts/create-db.sh
index ddebc5c..85617c6 100755
--- a/projects/oracle-server-scripts/create-db.sh
+++ b/projects/oracle-server-scripts/create-db.sh
@@ -295,7 +295,6 @@ function m4_macros() {
if [ -z "$db" ] ; then return ; fi
echo -I $Oracle/admin/$OracleVersionShort \
--define RHNORA_ADMIN_PATH=$AdminDB \
- --define RHNORA_LOG_PATH=RHNORA_ADMIN_PATH/logs \
--define RHNORA_DBNAME=$db \
--define RHNORA_DATA_PATH=$DataDB \
--define RHNORA_ORACLE_HOME=$ORACLE_HOME \
@@ -308,7 +307,9 @@ function CreateDatabase() {
db=$2
if [ -z "$db" ] ; then return ; fi
+ # sqlplus ... | cat ... is here to fool selinux, since oracle_sqlplus_t
m4 $(m4_macros $db) $template | $ORACLE_HOME/bin/sqlplus /nolog \
+ | cat >$AdminDB/logs/create_$db.log \
|| exit $?
}
diff --git a/projects/oracle-server-scripts/embedded-createdb.tmpl b/projects/oracle-server-scripts/embedded-createdb.tmpl
index f2b7df4..945f449 100644
--- a/projects/oracle-server-scripts/embedded-createdb.tmpl
+++ b/projects/oracle-server-scripts/embedded-createdb.tmpl
@@ -1,6 +1,5 @@
include(`rhnora.m4')
-spool RHNORA_CREATELOG(RHNORA_DBNAME) replace
set echo on
set term on
set pagesize 10000
@@ -86,33 +85,23 @@ set term off
whenever sqlerror continue
select 'rdbms/admin/catalog.sql' script from dual;
-spool RHNORA_CREATELOG(catalog)
@?/rdbms/admin/catalog.sql
-spool RHNORA_CREATELOG(RHNORA_DBNAME) append
select 'rdbms/admin/catblock.sql' script from dual;
-spool RHNORA_CREATELOG(catblock)
@?/rdbms/admin/catblock.sql
-spool RHNORA_CREATELOG(RHNORA_DBNAME) append
select 'rdbms/admin/catproc.sql' script from dual;
-spool RHNORA_CREATELOG(catproc)
@?/rdbms/admin/catproc.sql
-spool RHNORA_CREATELOG(RHNORA_DBNAME) append
select 'rdbms/admin/owminst.plb' script from dual;
-spool RHNORA_CREATELOG(owminst)
@?/rdbms/admin/owminst.plb
-spool RHNORA_CREATELOG(RHNORA_DBNAME) append
whenever sqlerror exit failure
connect system/RHNORA_DB_PASSWORD
whenever sqlerror continue
select 'sqlplus/admin/pupbld.sql' script from dual;
-spool RHNORA_CREATELOG(pupbld)
@?/sqlplus/admin/pupbld.sql
-spool RHNORA_CREATELOG(RHNORA_DBNAME) append
-- back to our code
set echo on
@@ -155,9 +144,7 @@ grant create trigger to RHNORA_DB_USER;
connect RHNORA_DB_USER/RHNORA_DB_PASSWORD
select 'rdbms/admin/utlxplan.sql' script from dual;
-spool RHNORA_CREATELOG(utlxplan)
@?/rdbms/admin/utlxplan.sql
-spool RHNORA_CREATELOG(RHNORA_DBNAME) append
disconnect
diff --git a/projects/oracle-server-scripts/embedded-upgradedb-10g.tmpl b/projects/oracle-server-scripts/embedded-upgradedb-10g.tmpl
index 609c9de..fc1754a 100644
--- a/projects/oracle-server-scripts/embedded-upgradedb-10g.tmpl
+++ b/projects/oracle-server-scripts/embedded-upgradedb-10g.tmpl
@@ -5,7 +5,6 @@ include(`rhnora.m4')
--
-spool RHNORA_CREATELOG(RHNORA_DBNAME-10g-10g-upgrade) replace
set echo on
set term on
set pagesize 10000
diff --git a/projects/oracle-server-scripts/embedded-upgradedb.tmpl b/projects/oracle-server-scripts/embedded-upgradedb.tmpl
index b0c924e..89f17b4 100644
--- a/projects/oracle-server-scripts/embedded-upgradedb.tmpl
+++ b/projects/oracle-server-scripts/embedded-upgradedb.tmpl
@@ -5,7 +5,6 @@ include(`rhnora.m4')
--
-spool RHNORA_CREATELOG(RHNORA_DBNAME-9i-10g-upgrade) replace
set echo on
set term on
set pagesize 10000
diff --git a/spacewalk/setup/share/oracle/upgrade-db.sh b/spacewalk/setup/share/oracle/upgrade-db.sh
index d7de872..3715fc1 100644
--- a/spacewalk/setup/share/oracle/upgrade-db.sh
+++ b/spacewalk/setup/share/oracle/upgrade-db.sh
@@ -107,11 +107,12 @@ else
UPGRADE_TMPL=$ORACLE_ADMIN_DIR/embedded-upgradedb-10g.tmpl
fi
+# sqlplus ... | cat ... is here to fool selinux, since oracle_sqlplus_t
m4 $UPGRADE_TMPL -I$ORACLE_ADMIN_DIR \
--define RHNORA_DBNAME=$ORACLE_SID \
- --define RHNORA_LOG_PATH=/rhnsat/admin/rhnsat/logs \
--define RHNORA_DATA_PATH=/rhnsat/data/rhnsat \
--define RHNORA_DB_USER=$DB_USER \
- | $ORACLE_HOME/bin/sqlplus /nolog
+ | $ORACLE_HOME/bin/sqlplus /nolog \
+ | cat /rhnsat/admin/rhnsat/logs/create_$ORACLE_SID.log
set +x