Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Non-ascii characters in password: msg#00230

db.tds.freetds

Subject: Re: Non-ascii characters in password

On Sat, 22 Nov 2003, SV Subramanian <mani_svs@xxxxxxxxxxxxxx> wrote:
> I have a difficulty in connecting from a linux machine to MSSQL 7 using
> TDS version 7.
> I am using unixODBC and freetds 0.61.2. Everything woorks perfectly when
> I connect as a user
> whose password contains ascii characters. Some of the accounts have
> passwords that have been created by custom algorithm and contain
> non-ascii characters. Is there a a way I can put character
> translation off during connect? I suppose that could be the reason.

The password is provided in the client's local character set, and we
convert it with iconv(3) to UCS-2. We can't turn "character translation
off" for passwords, because there's no way to pass in a UCS-2 password
(unless of course that's the client's encoding).

Rather, the way to ensure sending the server the correct UCS-2 password is
to make sure iconv(3) knows the client's true character set. The best way
to do that is with the "client charset" in freetds.conf.

I've attached a snippet of our current code, so you can see what's going
on. You'll find similar code in login.c::tds7_send_login() for 0.61.2.
You might try logging the input and output buffers to verify that we're
sending the right string (or not).

HTH.

--jkl


In CVS, src/tds/login.c:884:

unicode_left = sizeof(unicode_string);
if (tds_iconv(tds, tds->iconv_info[client2ucs2], to_server, &p,
&password_len, &punicode, &unicode_left) ==
(size_t) - 1) {
tdsdump_log(TDS_DBG_INFO1, "%L password \"%s\" could not be
converted to UCS-2\n", p);
assert(0);
}
password_len = punicode - unicode_string;
tds7_crypt_pass((unsigned char *) unicode_string, password_len,
(unsigned
char *) unicode_string);
tds_put_n(tds, unicode_string, password_len);


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation