From b41074c92bddd40c980b52bce6876df00e64216c Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Wed, 29 Mar 2017 13:47:16 +0300 Subject: [PATCH] Disable MaxAdmin automatic file reading Previously, MaxAdmin would interpret any non-option words in the command line as either a filename or, if the file could not be opened, as MaxAdmin commands. This made it possible to mix filenames and commands if there was a matching filename in the folder. For example "maxadmin show services" would read commands from a file named "show services" if it existed. This update removes this feature. To read commands from a file, use either shell redirection "maxadmin < mycommands" or the "source"-command inside maxadmin. --- client/maxadmin.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/client/maxadmin.c b/client/maxadmin.c index 9bfafd577..3a27083c0 100644 --- a/client/maxadmin.c +++ b/client/maxadmin.c @@ -14,17 +14,6 @@ /** * @file maxadmin.c - The MaxScale administration client * - * @verbatim - * Revision History - * - * Date Who Description - * 13/06/14 Mark Riddoch Initial implementation - * 15/06/14 Mark Riddoch Addition of source command - * 26/06/14 Mark Riddoch Fix issue with final OK split across - * multiple reads - * 17/05/16 Massimiliano Pinto Addition of UNIX socket support - * - * @endverbatim */ #include @@ -297,15 +286,7 @@ main(int argc, char **argv) strcat(cmd, argv[i]); } } - - if (access(cmd, R_OK) == 0) - { - DoSource(so, cmd); - } - else - { - sendCommand(so, cmd); - } + sendCommand(so, cmd); free(cmd); exit(0);