Bug 485706 - db-control report does not work in SELinux Enforcing mode.
db-control report does not work in SELinux Enforcing mode.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server (Show other bugs)
530
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jan Pazdziora
wes hayutin
:
Depends On:
Blocks: 457079
  Show dependency treegraph
 
Reported: 2009-02-16 09:32 EST by Brandon Perkins
Modified: 2009-09-10 15:12 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 15:12:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brandon Perkins 2009-02-16 09:32:04 EST
Description of problem:
db-control report does not work in SELinux Enforcing mode.

Version-Release number of selected component (if applicable):
Satellite-5.3.0-RHEL5-re20090213.1-i386-embedded-oracle

How reproducible:
Always.

Steps to Reproduce:
1. Install Satellite.
2. [root@rlx-3-14 ~]# su - oracle
3. -bash-3.2$ db-control report
  
Actual results:
Can't load '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: /opt/apps/oracle/web/product/10.2.0/db_1/lib/libnnz10.so: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
 at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
Compilation failed in require at /usr/bin/db-control line 11.
BEGIN failed--compilation aborted at /usr/bin/db-control line 11.


Expected results:
Working db-control report output.

Additional info:
db-control report works fine in SELinux Permissive mode.
Comment 1 Jan Pazdziora 2009-02-16 09:56:19 EST
Could you do

# semodule -l | grep oracle

? I assume due to the unconfined_devpts_t problem, SELinux modules are not loaded on this compose at all.

Also, rhn-installation.log will probably have something like

libsepol.print_missing_requirements: spacewalk's global requirements were not met: type/attribute oracle_port_t
libsemanage.semanage_link_sandbox: Link packages failed
/usr/sbin/semodule:  Failed!
libsepol.context_from_record: type cobbler_port_t is not defined
libsepol.context_from_record: could not create context structure
libsepol.port_from_record: could not create port structure for range 25152:25152 (tcp)
libsepol.sepol_port_modify: could not load port range 25152 - 25152 (tcp)
libsemanage.dbase_policydb_modify: could not modify record value
libsemanage.semanage_base_merge_components: could not merge local modifications into policy
/usr/sbin/semanage: Could not add port tcp/25152

it it.

I'm working on a fix.
Comment 2 Jan Pazdziora 2009-02-16 10:39:10 EST
After fixing the unconfined_devpts_t issue, I got

Can't load '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: /opt/apps/oracle/web/product/10.2.0/db_1/lib/libocci.so.10.1: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
 at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
Compilation failed in require at /usr/bin/db-control line 11.
BEGIN failed--compilation aborted at /usr/bin/db-control line 11.
Comment 3 Jan Pazdziora 2009-02-16 10:43:20 EST
The problem is that interactive oracle user has

LD_LIBRARY_PATH=/opt/apps/oracle/web/product/10.2.0/db_1/lib

set. So we are using

-rwxrwxr-x  oracle dba system_u:object_r:lib_t          /opt/apps/oracle/web/product/10.2.0/db_1/lib/libocci.so.10.1

instead of

-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t /usr/lib/oracle/10.2.0.4/client/lib/libocci.so.10.1

So:

su oracle -c 'db-control report' works.
su - oracle -c 'db-control report' does not

I'll change the context on /opt/apps/oracle/web/product/10.2.0/db_1/lib/libocci.so.10.1 but I wonder if it's correct that DBD::Oracle uses non-InstantClient libraries.
Comment 4 Jan Pazdziora 2009-02-16 11:08:06 EST
The unconfined_devpts_t problem fixed in 2d664ad720651b3fd31dfd9afcb5050fd31aeab8, the libocci.so.10.1 in d4995d6ea8f2523a33a7cf47d1e74e49a2bec0db.
Comment 5 Jan Pazdziora 2009-02-24 07:31:00 EST
With compose Satellite-5.3.0-RHEL5-re20090220.1 available, moving ON_QA.
Comment 6 wes hayutin 2009-03-09 17:05:33 EDT
[root@grandprix ~]# su - oracle
-bash-3.2$ db-control report
Tablespace                  Size    Used   Avail   Use%
DATA_TBS                    3.9G    3.1G  775.8M    81%
SYSAUX                      250M   64.4M  185.5M    26%
SYSTEM                      400M  239.9M    160M    60%
UNDO_TBS                    500M  177.5M  322.4M    36%
USERS                       128M     64K  127.9M     0%
-bash-3.2$ exit
logout
[root@grandprix ~]# getenforce 
Enforcing
[root@grandprix ~]#
Comment 7 Milan Zazrivec 2009-09-02 07:30:26 EDT
Verified in stage with the exact same results as stated in the comment
above -> RELEASE_PENDING
Comment 8 Brandon Perkins 2009-09-10 15:12:08 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

Note You need to log in before you can comment on or make changes to this bug.