|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-05-09 17:00 UTC] stephane dot dekeyzer at kmi dot be
Description:
------------
OCILogon, OCIPLogon, doesn't support external authentication to the database ...
I know this a ecurity hole if you use php with apache, but when you use it in scripting mode, it is very usefull, and itsn't a security breach.
I met Christopher Jones last week at the PHP conference in Amsterdam who agreed and asked me to post this bug so OCI developpers can discuss about it.
It would a be a good idea when php runs without apache, external authentication would be allowed.
I have a modification of the oci8.c wich support external authentication, just mail me if you want to have it !
Reproduce code:
---------------
$conn = OCILogon("", "", mydb); // should work
$conn = OCILogon("/", "", mydb); // should also work
$conn = OCILogon(null, null, mydb); // should also work
Expected result:
----------------
$conn = OCILogon(null, null, mydb); // should work and log me in as the os user curently running the script
Actual result:
--------------
$conn = OCILogon(null, null, mydb); // gives an error.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 14:00:02 2025 UTC |
simplified version: if(external authentication){ do ext authentication } else{ do login/password authentication } after line 2819, here a re my new lines: if(strcmp(username, "/") == 0 && strlen(password) == 0 || strlen(username) == 0 && strlen(password) == 0){ /* doing external authentication (OCI_CRED_EXT) */ CALL_OCI_RETURN(OCI(error), OCISessionBegin( svchp, OCI(pError), session->pSession, (ub4) OCI_CRED_EXT, (ub4) OCI_DEFAULT ) ); } else { /* set the username in user handle */ CALL_OCI_RETURN(OCI(error), OCIAttrSet( (dvoid *) session->pSession, (ub4) OCI_HTYPE_SESSION, (dvoid *) username, (ub4) strlen(username), (ub4) OCI_ATTR_USERNAME, OCI(pError) ) ); if (OCI(error) != OCI_SUCCESS) { oci_error(OCI(pError), "OCIAttrSet OCI_ATTR_USERNAME", OCI(error)); goto CLEANUP; } /* set the password in user handle */ CALL_OCI_RETURN(OCI(error), OCIAttrSet( (dvoid *) session->pSession, (ub4) OCI_HTYPE_SESSION, (dvoid *) password, (ub4) strlen(password), (ub4) OCI_ATTR_PASSWORD, OCI(pError) ) ); if (OCI(error) != OCI_SUCCESS) { oci_error(OCI(pError), "OCIAttrSet OCI_ATTR_PASSWORD", OCI(error)); goto CLEANUP; } CALL_OCI_RETURN(OCI(error), OCISessionBegin( svchp, OCI(pError), session->pSession, (ub4) OCI_CRED_RDBMS, (ub4) OCI_DEFAULT ) ); }