1

I have to connect my Perl script to a newly constructed Sybase server version - 16.0.03.08.1019

Error - login  Failed (due to encrypt password issue)

Previously the script was written in Perl:

$conn = Sybase::DBlib->new($user,$pass,$server,"$dbase Handle");
$conn->sql("use $dbase");

I searched online every where it is written put EncryptPassword=1.

I tried two ways shown below, but couldn't succeed.

$conn = Sybase::DBlib->new($user,$pass,$server,"$dbase Handle","EncryptPassword=1");
$conn = Sybase::DBlib->new("EncryptPassword=1",$user,$pass,$server,"$dbase Handle");

My question is, where to use EncryptPassword=1 in Perl script. Am I using it in correct place.

1 Answer 1

2

Wow! DBlib - that takes me back. When I last worked with DBlib (in about 1995), one of the tasks on my list was to replace all use of DBlib with CTlib - which was Sybase's new technology that was intended to replace DBlib. Soon after that, the system was rewritten again to use DBI and DBD::Sybase - which has been the recommended way to talk to Sybase databases from Perl programs for over twenty years. You'll note that the most recent release of sybperl (which is the CPAN distribution containing Sybase::DBlib and Sybase::CTlib) was over ten years ago. I'm pretty sure that Sybase themselves haven't supported DBlib since about the start of this millennium.

So, bearing in mind that you're using ancient technology that is largely dead and shouldn't be used, is there anything that can be done to help you without rewriting the whole system?

Perhaps.

Looking at the documentation for Sybase::DBlib, I see this example of how to write calls to new():

$dbh = new Sybase::DBlib [$user [, $pwd [, $server [, $appname [, {additional attributes}]]]]]

Ignore the fact that it's using the new Class syntax that any rational programmer would avoid - the Class->new() version is this:

$dbh = Sybase::DBlib->new([$user [, $pwd [, $server [, $appname [, {additional attributes}]]]]])

Note the "additional attributes" field at the end. I bet that's where your stuff needs to go. Note also, that it's { additional attributes } - so it looks like it expects a hash reference.

So it seems likely that the syntax you want is this:

$conn = Sybase::DBlib->new($user, $pass, $server, "$dbase Handle", {
  EncryptPassword => 1,
});

Note that there are huge caveats in this. Not least, given that Sybase::DBlib has been unsupported for ten years, I wouldn't be at all surprised if it didn't support encrypted passwords at all.

But it might work. It's probably your best hope.

And please do whatever you can to update your codebase to use tools and libraries that haven't been unsupported for such a long time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.