From:             cjbj at hotmail dot com
Operating system: Linux
PHP version:      5.1.2
PHP Bug Type:     OCI8 related
Bug description:  Privileged connection with an Oracle password file fails

Description:
------------
When oci_connect() uses OCI_SYSDBA or OCI_SYSOPER, oci8.c always calls
OCISessionBegin() with OCI_CRED_EXT.  This needs to be changed to
OCI_CRED_RDBMS in some cases so privileged connections can be
authenticated by an Oracle password file.

When OCI_SYSDBA or OCI_SYSOPER are specified:
    if the username is "/" and there is no password then
        the credential should be OCI_CRED_EXT
    else
        the credential should be OCI_CRED_RDBMS

There are two success cases of interest:

Case 1: oci8.c should use OCI_CRED_EXT.

  Connect succeds if the process running PHP is in Oracle's OS dba
  group and the DB is "local" i.e on the same host and specified by
  ORACLE_SID environment variable.  Otherwise connection will fail.

      oci_connect("/", "", NULL, OCI_SYSDBA);

Case 2: oci8.c should use OCI_CRED_RDBMS.

  Connect succeeds if the user is in Oracle's password file.  The DB
  can be on a remote host.

      // Note DB name could be NULL.
      oci_connect("un", "pw", "MYSID", OCI_SYSDBA);

Note: the php.ini parameter oci8.privileged_connect must be true for
PHP to allow OCI_SYSDBA or OCI_SYSOPER connections.


Actual result:
--------------
Currently case 2 gives ORA-01031: insufficient privileges in test.php on
line 3.

-- 
Edit bug report at http://bugs.php.net/?id=36820&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36820&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36820&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36820&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36820&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36820&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36820&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36820&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36820&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36820&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36820&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36820&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36820&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36820&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36820&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36820&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36820&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36820&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36820&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36820&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36820&r=mysqlcfg

Reply via email to