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: 2021-06-09 20:53 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: morozov at tut dot by Assigned: cmb (profile)
Status: Closed Package: PDO OCI
PHP Version: 7.2.11 OS: Linux
Private report: No CVE-ID: None
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-09 20:53 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 08:03:16 2021 UTC