php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77120 PDO OCI doesn't probably handle OCI_SUCCESS_WITH_INFO errors
Submitted: 2018-11-08 03:22 UTC Modified: -
From: morozov at tut dot by Assigned:
Status: Open Package: PDO OCI
PHP Version: 7.2.11 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: morozov at tut dot by
New email:
PHP Version: OS:

 

 [2018-11-08 03:22 UTC] morozov at tut dot by
Description:
------------
The PDO OCI driver converts OCI_SUCCESS_WITH_INFO errors to exceptions which makes it impossible to connect to the server when the user's password is about to expire but is still valid.

A similar issue was fixed earlier in the oci8 extension: https://bugs.php.net/bug.php?id=31623

Create a test user in SQLPlus:

> CREATE PROFILE test_profile LIMIT PASSWORD_LIFE_TIME 0.001 PASSWORD_GRACE_TIME 0.001;
> CREATE USER bob IDENTIFIED BY password PROFILE test_profile;
> GRANT CREATE SESSION TO bob;

Run the following PHP script:

Test script:
---------------
$conn = new PDO('oci:dbname=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))', 'bob', 'password');

Expected result:
----------------
The connection is successfully established

Actual result:
--------------
PDOException: SQLSTATE[HY000]: OCISessionBegin: OCI_SUCCESS_WITH_INFO: ORA-28002: the password will expire within 0 days
 (ext/pdo_oci/oci_driver.c:685) in test.php on line 3

Call Stack:
    0.0001     394880   1. {main}() test.php:0
    0.0001     395176   2. PDO->__construct() test.php:3


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Mar 24 13:01:25 2019 UTC