Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

ASE 15 password encryption and PHP

9 posts in General Discussion Last posting was on 2009-06-12 15:08:32.0Z
George Brink Posted on 2009-06-10 15:55:32.0Z
From: George Brink <siberianowl@yahoo.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: ASE 15 password encryption and PHP
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a2fd774$1@forums-1-dub>
Date: 10 Jun 2009 08:55:32 -0700
X-Trace: forums-1-dub 1244649332 10.22.241.152 (10 Jun 2009 08:55:32 -0700)
X-Original-Trace: 10 Jun 2009 08:55:32 -0700, vip152.sybase.com
Lines: 2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27836
Article PK: 77086

How to connect to ASE15 server with password encryption from PHP?


J Posted on 2009-06-10 20:50:35.0Z
From: jtotally_bogus@sbcglobal.net (J)
Newsgroups: sybase.public.ase.general
Subject: Re: ASE 15 password encryption and PHP
Reply-To: J@bogusemailAddress.com
Message-ID: <4a301c24.21429283@forums.sybase.com>
References: <4a2fd774$1@forums-1-dub>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 10 Jun 2009 13:50:35 -0700
X-Trace: forums-1-dub 1244667035 10.22.241.152 (10 Jun 2009 13:50:35 -0700)
X-Original-Trace: 10 Jun 2009 13:50:35 -0700, vip152.sybase.com
Lines: 18
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27837
Article PK: 77089

On 10 Jun 2009 08:55:32 -0700, George Brink <siberianowl@yahoo.com>
wrote:

George,

I don't know the PHP part of this. The ctlib connection property is
set like this on the connection in the same place you set the login
name and the password:

CS_BOOL isTrue = CS_TRUE;

ret = ct_con_props(connection, CS_SET, CS_SEC_ENCRYPTION,
&isTrue, CS_UNUSED, NULL);

Jay

>How to connect to ASE15 server with password encryption from PHP?


George Brink Posted on 2009-06-10 21:26:53.0Z
From: George Brink <siberianowl@yahoo.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: ASE 15 password encryption and PHP
References: <4a2fd774$1@forums-1-dub> <4a301c24.21429283@forums.sybase.com>
In-Reply-To: <4a301c24.21429283@forums.sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a30251d$1@forums-1-dub>
Date: 10 Jun 2009 14:26:53 -0700
X-Trace: forums-1-dub 1244669213 10.22.241.152 (10 Jun 2009 14:26:53 -0700)
X-Original-Trace: 10 Jun 2009 14:26:53 -0700, vip152.sybase.com
Lines: 26
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27838
Article PK: 77088

I know how to connect through CtLib...
Just looked at the source code for latest PHP 5.2.9 - no luck, standard
module does not have such code and it does not use external
configuration file and no extra keys, options, nothing...
I guess I would have to recompile PHP myself. So much troubles :(

J wrote:
> On 10 Jun 2009 08:55:32 -0700, George Brink <siberianowl@yahoo.com>
> wrote:
>
> George,
>
> I don't know the PHP part of this. The ctlib connection property is
> set like this on the connection in the same place you set the login
> name and the password:
>
> CS_BOOL isTrue = CS_TRUE;
>
> ret = ct_con_props(connection, CS_SET, CS_SEC_ENCRYPTION,
> &isTrue, CS_UNUSED, NULL);
>
> Jay
>
>> How to connect to ASE15 server with password encryption from PHP?
>


J Posted on 2009-06-11 15:52:26.0Z
From: jtotally_bogus@sbcglobal.net (J)
Newsgroups: sybase.public.ase.general
Subject: Re: ASE 15 password encryption and PHP
Reply-To: J@bogusemailAddress.com
Message-ID: <4a312207.1669971@forums.sybase.com>
References: <4a2fd774$1@forums-1-dub> <4a301c24.21429283@forums.sybase.com> <4a30251d$1@forums-1-dub>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 11 Jun 2009 08:52:26 -0700
X-Trace: forums-1-dub 1244735546 10.22.241.152 (11 Jun 2009 08:52:26 -0700)
X-Original-Trace: 11 Jun 2009 08:52:26 -0700, vip152.sybase.com
Lines: 50
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27840
Article PK: 77090

On 10 Jun 2009 14:26:53 -0700, George Brink <siberianowl@yahoo.com>
wrote:

You should be able to make it use a configuration setting. In 15.x
the configuration file can be private to the process. Try this (Unix
c-shell syntax)

setenv SYBOCS_CFG <dir path>/.myocs.cfg

myocs.cfg
------------
; This is the default external configuration definition file. Feel
free
; to add your own customizations.
;
[DEFAULT]

CS_SEC_ENCRYPTION = CS_TRUE

Jay

>I know how to connect through CtLib...
>Just looked at the source code for latest PHP 5.2.9 - no luck, standard
>module does not have such code and it does not use external
>configuration file and no extra keys, options, nothing...
>I guess I would have to recompile PHP myself. So much troubles :(
>
>
>J wrote:
>> On 10 Jun 2009 08:55:32 -0700, George Brink <siberianowl@yahoo.com>
>> wrote:
>>
>> George,
>>
>> I don't know the PHP part of this. The ctlib connection property is
>> set like this on the connection in the same place you set the login
>> name and the password:
>>
>> CS_BOOL isTrue = CS_TRUE;
>>
>> ret = ct_con_props(connection, CS_SET, CS_SEC_ENCRYPTION,
>> &isTrue, CS_UNUSED, NULL);
>>
>> Jay
>>
>>> How to connect to ASE15 server with password encryption from PHP?
>>


George Brink Posted on 2009-06-11 18:42:57.0Z
From: George Brink <siberianowl@yahoo.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: ASE 15 password encryption and PHP
References: <4a2fd774$1@forums-1-dub> <4a301c24.21429283@forums.sybase.com> <4a30251d$1@forums-1-dub> <4a312207.1669971@forums.sybase.com>
In-Reply-To: <4a312207.1669971@forums.sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a315031$1@forums-1-dub>
Date: 11 Jun 2009 11:42:57 -0700
X-Trace: forums-1-dub 1244745777 10.22.241.152 (11 Jun 2009 11:42:57 -0700)
X-Original-Trace: 11 Jun 2009 11:42:57 -0700, vip152.sybase.com
Lines: 56
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27844
Article PK: 77094

Just tried that approach - no luck.
Looks like it does not use external configuration file at all.
In PHP sources it calls ct_init() with CS_VERSION_100. Is this version
is too old for making use of ocs.cfg?

J wrote:
> On 10 Jun 2009 14:26:53 -0700, George Brink <siberianowl@yahoo.com>
> wrote:
>
> You should be able to make it use a configuration setting. In 15.x
> the configuration file can be private to the process. Try this (Unix
> c-shell syntax)
>
> setenv SYBOCS_CFG <dir path>/.myocs.cfg
>
> myocs.cfg
> ------------
> ; This is the default external configuration definition file. Feel
> free
> ; to add your own customizations.
> ;
> [DEFAULT]
>
> CS_SEC_ENCRYPTION = CS_TRUE
>
> Jay
>
>
>
>> I know how to connect through CtLib...
>> Just looked at the source code for latest PHP 5.2.9 - no luck, standard
>> module does not have such code and it does not use external
>> configuration file and no extra keys, options, nothing...
>> I guess I would have to recompile PHP myself. So much troubles :(
>>
>>
>> J wrote:
>>> On 10 Jun 2009 08:55:32 -0700, George Brink <siberianowl@yahoo.com>
>>> wrote:
>>>
>>> George,
>>>
>>> I don't know the PHP part of this. The ctlib connection property is
>>> set like this on the connection in the same place you set the login
>>> name and the password:
>>>
>>> CS_BOOL isTrue = CS_TRUE;
>>>
>>> ret = ct_con_props(connection, CS_SET, CS_SEC_ENCRYPTION,
>>> &isTrue, CS_UNUSED, NULL);
>>>
>>> Jay
>>>
>>>> How to connect to ASE15 server with password encryption from PHP?
>


Michael Peppler [Team Sybase] Posted on 2009-06-11 18:49:36.0Z
From: "Michael Peppler [Team Sybase]" <mpeppler@peppler.org>
Organization: Peppler Consulting SARL
Subject: Re: ASE 15 password encryption and PHP
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Message-ID: <pan.2009.06.11.18.49.35.793452@peppler.org>
Newsgroups: sybase.public.ase.general
References: <4a2fd774$1@forums-1-dub> <4a301c24.21429283@forums.sybase.com> <4a30251d$1@forums-1-dub> <4a312207.1669971@forums.sybase.com> <4a315031$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 11 Jun 2009 11:49:36 -0700
X-Trace: forums-1-dub 1244746176 10.22.241.152 (11 Jun 2009 11:49:36 -0700)
X-Original-Trace: 11 Jun 2009 11:49:36 -0700, vip152.sybase.com
Lines: 17
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27845
Article PK: 77096


On Thu, 11 Jun 2009 11:42:57 -0700, George Brink wrote:

> Just tried that approach - no luck.
> Looks like it does not use external configuration file at all.
> In PHP sources it calls ct_init() with CS_VERSION_100. Is this version
> is too old for making use of ocs.cfg?

Check to see whether PHP's module sets the CS_EXTERNAL_CONFIG property to
false - I know I do it for DBD::Sybase.

if(cs_config(context, CS_SET, CS_EXTERNAL_CONFIG, &boolean, CS_UNUSED,
NULL) != CS_SUCCEED) {


Michael


George Brink Posted on 2009-06-11 19:03:35.0Z
From: George Brink <siberianowl@yahoo.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: ASE 15 password encryption and PHP
References: <4a2fd774$1@forums-1-dub> <4a301c24.21429283@forums.sybase.com> <4a30251d$1@forums-1-dub> <4a312207.1669971@forums.sybase.com> <4a315031$1@forums-1-dub> <pan.2009.06.11.18.49.35.793452@peppler.org>
In-Reply-To: <pan.2009.06.11.18.49.35.793452@peppler.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a315507$1@forums-1-dub>
Date: 11 Jun 2009 12:03:35 -0700
X-Trace: forums-1-dub 1244747015 10.22.241.152 (11 Jun 2009 12:03:35 -0700)
X-Original-Trace: 11 Jun 2009 12:03:35 -0700, vip152.sybase.com
Lines: 30
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27846
Article PK: 77097

No, it does not.
But documentation on cs_config() states that:
CS_EXTERNAL_CONFIG cannot be set, retrieved, or cleared unless the
CS_CONTEXT structure is allocated with CS_VERSION_110 or later.
(See cs_ctx_alloc for more information.)
And I already see that php_sybase_ct module call ct_init() with
CT_VERSION_100.
So I am wondering does OC actually try to use external configuration in
this mode? Or may be it just does not know anything about
CS_SEC_ENCRYPTION option and ignoring it?

Michael Peppler [Team Sybase] wrote:
> On Thu, 11 Jun 2009 11:42:57 -0700, George Brink wrote:
>
>> Just tried that approach - no luck.
>> Looks like it does not use external configuration file at all.
>> In PHP sources it calls ct_init() with CS_VERSION_100. Is this version
>> is too old for making use of ocs.cfg?
>
> Check to see whether PHP's module sets the CS_EXTERNAL_CONFIG property to
> false - I know I do it for DBD::Sybase.
>
> if(cs_config(context, CS_SET, CS_EXTERNAL_CONFIG, &boolean, CS_UNUSED,
> NULL) != CS_SUCCEED) {
>
>
> Michael
>
>


Neal Stack [Sybase] Posted on 2009-06-11 19:48:22.0Z
Message-ID: <4A315F86.5030205@nospam.com>
From: "Neal Stack [Sybase]" <nstack@nospam.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
To: George Brink <siberianowl@yahoo.com>
Subject: Re: ASE 15 password encryption and PHP
References: <4a2fd774$1@forums-1-dub> <4a301c24.21429283@forums.sybase.com> <4a30251d$1@forums-1-dub> <4a312207.1669971@forums.sybase.com> <4a315031$1@forums-1-dub> <pan.2009.06.11.18.49.35.793452@peppler.org> <4a315507$1@forums-1-dub>
In-Reply-To: <4a315507$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 11 Jun 2009 12:48:22 -0700
X-Trace: forums-1-dub 1244749702 10.22.241.152 (11 Jun 2009 12:48:22 -0700)
X-Original-Trace: 11 Jun 2009 12:48:22 -0700, vip152.sybase.com
Lines: 79
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27849
Article PK: 77106

Hello,

I just set my sample "firstapp.c" to use CS_VERSION_100:
context = (CS_CONTEXT *)NULL;
ret = cs_ctx_alloc(CS_VERSION_100, &context);
EXIT_ON_FAIL(context, ret, "cs_ctx_alloc failed");

/*
** Initialize Client-Library.
*/
ret = ct_init(context, CS_VERSION_100);
EXIT_ON_FAIL(context, ret, "ct_init failed");

Recompiled and ran it.

It does look for the external configuration file:
nstack-sun% truss -f -o firstapp.out firstapp
Server message:
number(5701) severity(10) state(2) line(0)
Server name: nstack_1502
Changed database context to 'master'.

White: Menlo Park
Green: Oakland
Carson: Berkeley
O'Leary: San Jose
Straight: Oakland
Bennet: Berkeley
Dull: Palo Alto
Gringlesby: Covelo
Locksley: San Francisco
Yokomoto: Walnut Creek
Stringer: Oakland
MacFeather: Oakland
Karsen: Oakland
Hunter: Palo Alto
McBadden: Vacaville

All done processing rows.
nstack-sun% grep ocs.cfg firstapp.out
28290/1: open("/software/ase1502/OCS-15_0/config/ocs.cfg", O_RDONLY) Err#2 ENOENT


Regards,
Neal

George Brink wrote:
> No, it does not.
> But documentation on cs_config() states that:
> CS_EXTERNAL_CONFIG cannot be set, retrieved, or cleared unless the
> CS_CONTEXT structure is allocated with CS_VERSION_110 or later.
> (See cs_ctx_alloc for more information.)
> And I already see that php_sybase_ct module call ct_init() with
> CT_VERSION_100.
> So I am wondering does OC actually try to use external configuration in
> this mode? Or may be it just does not know anything about
> CS_SEC_ENCRYPTION option and ignoring it?
>
>
> Michael Peppler [Team Sybase] wrote:
>> On Thu, 11 Jun 2009 11:42:57 -0700, George Brink wrote:
>>
>>> Just tried that approach - no luck.
>>> Looks like it does not use external configuration file at all.
>>> In PHP sources it calls ct_init() with CS_VERSION_100. Is this
>>> version is too old for making use of ocs.cfg?
>>
>> Check to see whether PHP's module sets the CS_EXTERNAL_CONFIG property to
>> false - I know I do it for DBD::Sybase.
>>
>> if(cs_config(context, CS_SET, CS_EXTERNAL_CONFIG, &boolean,
>> CS_UNUSED,
>> NULL) != CS_SUCCEED) {
>>
>>
>> Michael
>>
>>


J Posted on 2009-06-12 15:08:32.0Z
From: jtotally_bogus@sbcglobal.net (J)
Newsgroups: sybase.public.ase.general
Subject: Re: ASE 15 password encryption and PHP
Reply-To: J@bogusemailAddress.com
Message-ID: <4a326e76.45854024@forums.sybase.com>
References: <4a2fd774$1@forums-1-dub> <4a301c24.21429283@forums.sybase.com> <4a30251d$1@forums-1-dub> <4a312207.1669971@forums.sybase.com> <4a315031$1@forums-1-dub> <pan.2009.06.11.18.49.35.793452@peppler.org> <4a315507$1@forums-1-dub>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 12 Jun 2009 08:08:32 -0700
X-Trace: forums-1-dub 1244819312 10.22.241.152 (12 Jun 2009 08:08:32 -0700)
X-Original-Trace: 12 Jun 2009 08:08:32 -0700, vip152.sybase.com
Lines: 45
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:27857
Article PK: 77108

On 11 Jun 2009 12:03:35 -0700, George Brink <siberianowl@yahoo.com>
wrote:

The config file will be use regardless of the CS_EXTERNAL_CONIG file
settings. The comment is wrong in my experience.

My results agree with Neal. I would double check all setup re. the
PHP test. Are you certain that it picked up your env. settings for the
SYBOCS_CFG settings?

truss the process to insure that the config file is being read.

Jay

>No, it does not.
>But documentation on cs_config() states that:
> CS_EXTERNAL_CONFIG cannot be set, retrieved, or cleared unless the
> CS_CONTEXT structure is allocated with CS_VERSION_110 or later.
> (See cs_ctx_alloc for more information.)
>And I already see that php_sybase_ct module call ct_init() with
>CT_VERSION_100.
>So I am wondering does OC actually try to use external configuration in
>this mode? Or may be it just does not know anything about
>CS_SEC_ENCRYPTION option and ignoring it?
>
>
>Michael Peppler [Team Sybase] wrote:
>> On Thu, 11 Jun 2009 11:42:57 -0700, George Brink wrote:
>>
>>> Just tried that approach - no luck.
>>> Looks like it does not use external configuration file at all.
>>> In PHP sources it calls ct_init() with CS_VERSION_100. Is this version
>>> is too old for making use of ocs.cfg?
>>
>> Check to see whether PHP's module sets the CS_EXTERNAL_CONFIG property to
>> false - I know I do it for DBD::Sybase.
>>
>> if(cs_config(context, CS_SET, CS_EXTERNAL_CONFIG, &boolean, CS_UNUSED,
>> NULL) != CS_SUCCEED) {
>>
>>
>> Michael
>>
>>