[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    [freetds] Seg Faults in login.c; freetds version 0.53
From:       "cori lynn arnold" <ccavyell () riptech ! com>
Date:       2001-10-28 21:19:43
[Download RAW message or body]

Hello, this message is for: Eric Deutsch, Richard Norman & Bill Rayburn
(and everyone else getting a Seg Fault while trying to login).

I hacked freetds version 0.51 to work on the sparc solaris 8 platform back
in april, by manually reversing several bytes.  I desired a cleaner way to
use the sparc so i downloaded the 0.53 version noting comments on the
release that big-endian now works.

The symptom I noted in version 0.53 was a Seg Fault in login.c for TDS
version 7.0 while doing a strlen(config->host_name).  This happened on
both the linux and sparc solaris 8.

I've spent the weekend working on making this work for linux and solaris 8
on sparc.  I made changes in the tds7_send_login function only, and the
0.53 version now works beautifully on both platforms.

here are the changes i made:

after: if(!domain_login)  
remove: strlen(config->host_name) & strlen(config->language)

after:/* host name */
change: strlen(config->host_name) 
to: 0
remove next line: current_pos += strlen(config->host_name)*2;

after: /* language */
change: strlen(config->language)
to: 0
remove next line: current_pos += strlen(language)*2;

remove line: tds7_ascii2unicode(config->host_name, unicode_string,255);
and next line: tds_put_n(tds,unicode_string,strlen(config->host_name)*2);

remove line: tds7_ascii2unicode(config->language, unicode_string, 255);
and next line: tds_put_n(tds,unicode_string,strlen(config->language)*2);


This solution may look strange, but it had a methodology.  I figured 0.51
login worked so i made the 0.53 version login.c look the same.  I hacked
it on the linux box and moved the login.c file over to the sparc and
everything worked, wonderfully!

Thanks to the dev-freetds team for making the byte switching in the
tds_put and tds_get functions a lot cleaner than my own.

--cori lynn

---
You are currently subscribed to freetds as: [freetds@progressive-comp.com]
To unsubscribe, forward this message to leave-freetds-113879Q@franklin.oit.unc.edu

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic