|
|
Choosing A Webhost: |
Re: Non-ascii characters in password: msg#00230db.tds.freetds
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> |
|---|---|---|
| Previous by Date: | Non-ascii characters in password, SV Subramanian |
|---|---|
| Next by Date: | iconv message suppression, James K. Lowden |
| Previous by Thread: | Non-ascii characters in password, SV Subramanian |
| Next by Thread: | iconv message suppression, James K. Lowden |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |