From a5b9966c0da16112a7d429872dd459471b64a355 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jan 2004 16:06:26 -0100 Subject: Revise Windows build script, correct comment re NetWare in libmysql.c Build-tools/Do-win-build: Copy logfile for pickup by Do-compile-win libmysql/libmysql.c: Comment was previously inaccurate --- libmysql/libmysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 607d8af6e50..52d9139887e 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -585,7 +585,7 @@ char* getlogin(void); #if defined(__NETWARE__) -/* default to "root" on NetWare */ +/* Default to value of USER on NetWare, if unset use "UNKNOWN_USER" */ static void read_user_name(char *name) { char *str=getenv("USER"); -- cgit v1.2.1 From ddf17601f3db71fc7bd8531fcbe3b3222e58e87e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Feb 2004 09:11:46 +0100 Subject: potential problem fixed afer some reasoning --- libmysql/libmysql.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 607d8af6e50..e9a3857a73c 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -316,7 +316,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, char **arg_unix_socket) { HANDLE hPipe=INVALID_HANDLE_VALUE; - char szPipeName [ 257 ]; + char szPipeName [ 1024 ]; DWORD dwMode; int i; my_bool testing_named_pipes=0; @@ -327,9 +327,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, if (!host || !strcmp(host,LOCAL_HOST)) host=LOCAL_HOST_NAMEDPIPE; - sprintf( szPipeName, "\\\\%s\\pipe\\%s", host, unix_socket); - DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", - host, unix_socket)); + strxnmov(szPipeName, sizeof(szPipeName), "\\\\", host, "\\pipe\\", + unix_socket, NullS); + DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", host, unix_socket)); for (i=0 ; i < 100 ; i++) /* Don't retry forever */ { @@ -694,7 +694,7 @@ mysql_debug(const char *debug __attribute__((unused))) #else { char buff[80]; - strmov(strmov(buff,"libmysql: "),env); + strxnmov(buff,sizeof(buff),"libmysql: ", env); MessageBox((HWND) 0,"Debugging variable MYSQL_DEBUG used",buff,MB_OK); } #endif @@ -1746,7 +1746,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, (unix_socket && !strcmp(unix_socket,MYSQL_NAMEDPIPE))) { net->last_errno= CR_SERVER_LOST; - strmov(net->last_error,ER(net->last_errno)); + strmov(net->last_error,ER(net->last_errno)); goto error; /* User only requested named pipes */ } /* Try also with TCP/IP */ @@ -1832,7 +1832,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, vio_poll_read(net->vio, mysql->options.connect_timeout)) { net->last_errno= CR_SERVER_LOST; - strmov(net->last_error,ER(net->last_errno)); + strmov(net->last_error,ER(net->last_errno)); goto error; } if ((pkt_length=net_safe_read(mysql)) == packet_error) @@ -1984,7 +1984,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, if (my_net_write(net,buff,(uint) (2)) || net_flush(net)) { net->last_errno= CR_SERVER_LOST; - strmov(net->last_error,ER(net->last_errno)); + strmov(net->last_error,ER(net->last_errno)); goto error; } /* Do the SSL layering. */ @@ -1996,7 +1996,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, options->ssl_cipher))) { net->last_errno= CR_SSL_CONNECTION_ERROR; - strmov(net->last_error,ER(net->last_errno)); + strmov(net->last_error,ER(net->last_errno)); goto error; } DBUG_PRINT("info", ("IO layer change in progress...")); @@ -2036,7 +2036,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net)) { net->last_errno= CR_SERVER_LOST; - strmov(net->last_error,ER(net->last_errno)); + strmov(net->last_error,ER(net->last_errno)); goto error; } if (net_safe_read(mysql) == packet_error) -- cgit v1.2.1 From 68242939d818cf5d091d5dcf13e312994f423f9f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Feb 2004 22:04:31 +0200 Subject: Fixed usage of strxnmov() in recent changesets libmysql/libmysql.c: szPipeName -> pipe_name fixed usage of strxnmov() mysys/mf_tempfile.c: Fixed usage of strnxmov() Simple optimization mysys/my_tempnam.c: Fixed usage of strnxmov() Simple optimization sql/log.cc: simple optimization sql/mini_client.cc: szPipeName -> pipe_name fixed usage of strxnmov() sql/mysqld.cc: szPipeName -> pipe_name fixed usage of strxnmov() Fixed indentation --- libmysql/libmysql.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e9a3857a73c..1b98cb4af75 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -316,7 +316,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, char **arg_unix_socket) { HANDLE hPipe=INVALID_HANDLE_VALUE; - char szPipeName [ 1024 ]; + char pipe_name[1024]; DWORD dwMode; int i; my_bool testing_named_pipes=0; @@ -327,13 +327,15 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, if (!host || !strcmp(host,LOCAL_HOST)) host=LOCAL_HOST_NAMEDPIPE; - strxnmov(szPipeName, sizeof(szPipeName), "\\\\", host, "\\pipe\\", - unix_socket, NullS); + + pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */ + strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\", host, "\\pipe\\", + unix_socket, NullS); DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", host, unix_socket)); for (i=0 ; i < 100 ; i++) /* Don't retry forever */ { - if ((hPipe = CreateFile(szPipeName, + if ((hPipe = CreateFile(pipe_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, @@ -349,7 +351,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, return INVALID_HANDLE_VALUE; } /* wait for for an other instance */ - if (! WaitNamedPipe(szPipeName, connect_timeout*1000) ) + if (! WaitNamedPipe(pipe_name, connect_timeout*1000) ) { net->last_errno=CR_NAMEDPIPEWAIT_ERROR; sprintf(net->last_error,ER(net->last_errno),host, unix_socket, -- cgit v1.2.1