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.
This commit is contained in:
Esa Korhonen 2017-03-29 13:47:16 +03:00
parent a395db174e
commit b41074c92b

View File

@ -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 <assert.h>
@ -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);