summaryrefslogtreecommitdiff
path: root/sql/winservice.c
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-03-17 01:26:58 -0700
committerIgor Babaev <igor@askmonty.org>2012-03-17 01:26:58 -0700
commit5d954e7cd0f9f4106d848a7d7fc8fbce35668785 (patch)
treebd812fb49b473d759c5054fe89d12e4dc1e50a59 /sql/winservice.c
parentd110e0377dda1bb9f5a5c36745d3a6feb8e8a1d4 (diff)
parent5338a28912589f1169b66b880a489ec5636bcd83 (diff)
downloadmariadb-git-5d954e7cd0f9f4106d848a7d7fc8fbce35668785.tar.gz
Merge 5.3->5.5
Diffstat (limited to 'sql/winservice.c')
-rw-r--r--sql/winservice.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/sql/winservice.c b/sql/winservice.c
index 1f41cf61ea4..1cf9f8d7823 100644
--- a/sql/winservice.c
+++ b/sql/winservice.c
@@ -75,6 +75,41 @@ void normalize_path(char *path, size_t size)
}
/*
+ Exclusion rules.
+
+ Some hardware manufacturers deliver systems with own preinstalled MySQL copy
+ and services. We do not want to mess up with these installations. We will
+ just ignore such services, pretending it is not MySQL.
+
+ ´@return
+ TRUE, if this service should be excluded from UI lists etc (OEM install)
+ FALSE otherwise.
+*/
+BOOL exclude_service(mysqld_service_properties *props)
+{
+ static const char* exclude_patterns[] =
+ {
+ "common files\\dell\\mysql\\bin\\", /* Dell's private installation */
+ NULL
+ };
+ int i;
+ char buf[MAX_PATH];
+
+ /* Convert mysqld path to lower case, rules for paths are case-insensitive. */
+ memcpy(buf, props->mysqld_exe, sizeof(props->mysqld_exe));
+ _strlwr(buf);
+
+ for(i= 0; exclude_patterns[i]; i++)
+ {
+ if (strstr(buf, exclude_patterns[i]))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
Retrieve some properties from windows mysqld service binary path.
We're interested in ini file location and datadir, and also in version of
the data. We tolerate missing mysqld.exe.
@@ -256,7 +291,9 @@ int get_mysql_service_properties(const wchar_t *bin_path,
}
}
}
- retval = 0;
+
+ if (!exclude_service(props))
+ retval = 0;
end:
LocalFree((HLOCAL)args);
return retval;