Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

C-program connecting with olog()

МішаSep 4 2020 — edited Sep 5 2020

I have a fairly simple C-program, which connects to Oracle databases using the olog() function:

        if (olog(&lda, NULL,

            (OraText *)user, -1,

            (OraText *)password, -1,

            (OraText *)sid, sidlen,

            OCI_LM_DEF)) {

                errx(EX_NOPERM, "Logging into Oracle failed: %s",

                    oraerr(&lda, buf, sizeof(buf)));

        }

This usually just works... Recently we started deploying new Oracle servers (version 19c) and found the above code failing with ORA-01017 (invalid credentials), even though the same username/password are working with other tools (such as sqlplus).

What finally helped was:

  1. Set SQLNET.ALLOWED_VERSION_CLIENT=8.
  2. Reset the passwords -- to the same strings -- after the above change.

Why were these manipulations necessary? I understand, that olog() is an old API, but, as long as it is still included in the client library (we now use 18c on the client), it should "just work", shouldn't it?

It is not any less secure, than the newer OCILogon() -- both take username and password in clear text. So why does using olog() require gimmicks on the server to work -- and fails with a bogus error-message until the gimmicks are applied?

Perhaps, there is a way to make it work -- such as by setting something in the lda-structure (currently I simply bzero it before calling olog()).

(To those, who'd switch topic to tell me to change the API: no, I cannot do that, because the same program still needs to compile against much older Oracle-clients on some of our systems.)

Comments

Srikanth Mathivanan

Oracle experts, we are facing the same issue in our environment. We would like to understand where this “Set SQLNET.ALLOWED_VERSION_CLIENT=8” parameter needs to be set.

Is it in the Database server (Linux) or Oracle Database parameters (or) Development server (Windows - Oracle client folder)?

We appreciate the immediate response on this issue, so that we can move forward with our project delivery.

Srikanth Mathivanan

Hello,

Can someone @m-iwa in the Oracle forum assist with this issue?

1 - 2

Post Details

Added on Sep 4 2020
2 comments
1,855 views