Skip to Content.
Sympa Menu

freetds - Re: [freetds] Host process hard coded to 37876 for Sybase

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Host process hard coded to 37876 for Sybase
  • Date: Mon, 17 Aug 2009 18:53:43 +0200

Il giorno mer, 05/08/2009 alle 00.50 -0400, Wood, David ha scritto:
> Hello,
>
>
>
> It seems host process is currently hard coded to 37876 if using TDS <= 5
> (eg Sybase):
>
> % grep 37876 src/tds/login.c
>
> tds_put_login_string(tds, "37876", TDS_MAX_LOGIN_STR_SZ);
> /* host process */
>
>
>
> % tsql -Ufoo -SSYB1 -Pbar
>
> ...
>
> 1> select hostprocess from sysprocesses where spid = @@spid
>
> 2> go
>
> hostprocess
>
> 37876
>
> ^Z
>
>
>
> % ps -ef | grep tsql | grep -v grep
>
> woodd 2990 2832 0 00:38:09 pts/140 0:00 tsql -Ufoo -SSYB1
> -Pbar
>
>
>
> After applying the patch below:
>
>
>
> % tsql -Ufoo -SSYB1 -Pbar
>
> ...
>
> 1> select hostprocess from sysprocesses where spid = @@spid
>
> 2> go
>
> hostprocess
>
> 23294
>
> ^Z
>
>
>
> % ps -ef | grep tsql | grep -v grep
>
> woodd 23294 23233 0 00:41:47 pts/17 0:00 tsql -Ufoo -SSYB1
> -Pbar
>
>
>
> Context diff against CVS:
>
>
>
> *** login.c Wed Aug 5 00:45:23 2009
>
> --- login_patched.c Wed Aug 5 00:44:22 2009
>
> ***************
>
> *** 29,34 ****
>
> --- 29,38 ----
>
> #include <stdlib.h>
>
> #endif /* HAVE_STDLIB_H */
>
>
>
> + #ifdef HAVE_LIMITS_H
>
> + #include <limits.h>
>
> + #endif /* HAVE_LIMITS_H */
>
> +
>
> #include <assert.h>
>
>
>
> #if HAVE_STRING_H
>
> ***************
>
> *** 593,599 ****
>
> tds_put_login_string(tds,
> tds_dstr_cstr(&connection->client_host_name), TDS_MAX_LOGIN_STR_SZ); /*
> client host name */
>
> tds_put_login_string(tds, tds_dstr_cstr(&connection->user_name),
> TDS_MAX_LOGIN_STR_SZ); /* account name */
>
> tds_put_login_string(tds, tds_dstr_cstr(&connection->password),
> TDS_MAX_LOGIN_STR_SZ); /* account password */
>
> ! tds_put_login_string(tds, "37876", TDS_MAX_LOGIN_STR_SZ);
> /* host process */
>
> #ifdef WORDS_BIGENDIAN
>
> if (tds->emul_little_endian) {
>
> tds_put_n(tds, le1, 6);
>
> --- 597,605 ----
>
> tds_put_login_string(tds,
> tds_dstr_cstr(&connection->client_host_name), TDS_MAX_LOGIN_STR_SZ); /*
> client host name */
>
> tds_put_login_string(tds, tds_dstr_cstr(&connection->user_name),
> TDS_MAX_LOGIN_STR_SZ); /* account name */
>
> tds_put_login_string(tds, tds_dstr_cstr(&connection->password),
> TDS_MAX_LOGIN_STR_SZ); /* account password */
>
> ! char pbuf[PID_MAX+1];
>
> ! sprintf(pbuf, "%d", (int) getpid());
>
> ! tds_put_login_string(tds, pbuf, TDS_MAX_LOGIN_STR_SZ); /* host
> process */
>
> #ifdef WORDS_BIGENDIAN
>
> if (tds->emul_little_endian) {
>
> tds_put_n(tds, le1, 6);
>
>
>
> David
>

Applied on CVS HEAD, I only reused a buffer.

Thanks
Frediano






Archive powered by MHonArc 2.6.24.

Top of Page