Re: [Sqlrelay-discussion] sqlrsh from linux to solaris
Brought to you by:
mused
From: Firstworks/4access <dav...@fi...> - 2005-06-14 21:03:20
|
Yeah, that's definitely the problem. It's a known bug and it'll be fixed in the next release. I'm going to make a prerelease soon that has the fix in it too. The problem was that way back when I first started writing SQL Relay, I decided to use short, long and long long data types, assuming that they were 16,32 and 64 bits long on all platforms. This turned out to be untrue but I didn't notice until amd64 came out. A long is 64 bits on amd64 and so is a long long. So, if this code gets compiled on amd64: unsigned long a=5; write(fd,&a,sizeof(unsigned long)); Then it will try to write a 64 bit number. Where the same code compiled on a 32 bit machine (or more precisely, a machine where a long is 32 bits) will try to write a 32 bit number. If "fd" in the above example is a network socket open between a 32 and 64 bit machine, all heck breaks loose when one machine writes a 32 bit number and the other machine expects to read a 64 bit number or vice-versa. Recently I switched all the datatypes to int16_t, int32_t, int64_t, uint16_t, etc. It should fix the problem. Dave dav...@fi... On Tue, 2005-06-14 at 20:22 +0200, bogusz wrote: > Hello, > > Im getting following error when trying connect form linux sqlrsh to solaris > sqlrelay with oracle: > > root@solaris # cat sqlr-listener.26895 > 06/14/2005 18:43:06 CEST listener [26895] : getting authentication... > > 06/14/2005 18:43:06 CEST listener [26895] : authentication failed: password > size is wrong > > Local connection from Solaris works fine. > > My Linux box is SuSe 9 Enterprise x86_64 and Oracle box is Solaris 9. > > I found function responsible for this error: > > bool sqlrconnection::getPasswordFromClient() { > unsigned long size=0; > if (clientsock->read(&size)==sizeof(unsigned long) && > size<=(unsigned long)USERSIZE && > (unsigned > long)(clientsock->read(passwordbuffer,size))==size) { > passwordbuffer[size]=(char)NULL; > return true; > } > #ifdef SERVER_DEBUG > debugPrint("connection",1, > "authentication failed: password size is wrong"); > #endif > return false; > } > > Could it be that long formats in Sparc and AMD Opteron architectures cause > problem? > > Regards > > bogusz > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > Sqlrelay-discussion mailing list > Sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion > |