Commit d1a2db17 authored by jimw@mysql.com's avatar jimw@mysql.com

Restore behavior of 4.1 that allowed any one argument to be passed to the

server on Windows service startup, and not just --defaults-file=file. This
appears to be an unnecessary limitation, but fixing that will require
a larger refactoring of the Windows service installation and startup code.
(Bug #7856)
parent 50144020
...@@ -3375,37 +3375,32 @@ int main(int argc, char **argv) ...@@ -3375,37 +3375,32 @@ int main(int argc, char **argv)
return 0; return 0;
} }
} }
else if (argc >= 4) else if (argc == 4 || argc == 5)
{ {
const char *defaults_file = "--defaults-file"; /*
const char *service = "--local-service"; This may seem strange, because we handle --local-service while
char extra_opt[FN_REFLEN] = ""; preserving 4.1's behavior of allowing any one other argument that is
passed to the service on startup. (The assumption is that this is
--defaults-file=file, but that was not enforced in 4.1, so we don't
enforce it here.)
*/
char *extra_opt= NULL;
char *account_name = NULL; char *account_name = NULL;
char *option;
int index; int index;
for (index = 3; index < argc; index++) for (index = 3; index < argc; index++)
{ {
option= argv[index]; if (strncmp(argv[index], "--local-service", 15) == 0)
/*
Install an optional service with optional config file
mysqld --install-manual mysqldopt --defaults-file=c:\miguel\my.ini
*/
if (strncmp(option, defaults_file, strlen(defaults_file)) == 0)
{ {
strmov(extra_opt, option); account_name=(char*)malloc(27);
strmov(account_name, "NT AUTHORITY\\LocalService\0");
} }
else else
/*
Install an optional service as local service
mysqld --install-manual mysqldopt --local-service
*/
if (strncmp(option, service, strlen(service)) == 0)
{ {
account_name=(char*)malloc(27); extra_opt= argv[index];
strmov(account_name, "NT AUTHORITY\\LocalService\0");
} }
} }
if (argc != 5 || account_name)
if (!default_service_handling(argv, argv[2], argv[2], file_path, extra_opt, account_name)) if (!default_service_handling(argv, argv[2], argv[2], file_path, extra_opt, account_name))
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment