summaryrefslogtreecommitdiff
path: root/sql/CMakeLists.txt
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2022-01-31 15:40:41 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2022-01-31 20:10:08 +0100
commit12cea0971381fa7404555d2e5ae598a4e59ee7df (patch)
treec34873f080c05adaeaffc2dec883250f9723670f /sql/CMakeLists.txt
parent2a0962f39b3e7ef91915240176bab0abc03d2daa (diff)
downloadmariadb-git-12cea0971381fa7404555d2e5ae598a4e59ee7df.tar.gz
MDEV-27535 Service does not start after MSI install into restricted directory
This happens for example if one installs into home directory of a user C:\Users\<username>\mariadb The reason is that the service user "NT SERVICE\<service_name>" does not have read and execute permissions for service executable mysqld.exe in this directory. Moreover, it would not have read permissions for server.dll loaded by the exe, or to plugin directory, where plugins may reside. The fix is to give service users read and execute permissions to bin, share, and lib\plugin subdirectories. The permission setting is doneby mysql_install_db.exe, but also in MSI. It is important to do that in MSI, as we want permissions to survive the MSI upgrade.
Diffstat (limited to 'sql/CMakeLists.txt')
-rw-r--r--sql/CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index c63e4ecde9e..23a5062e0d4 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -479,7 +479,10 @@ IF(WIN32)
${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c
COMPONENT Server
)
- SET_TARGET_PROPERTIES(mariadb-install-db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR})
+
+ SET_TARGET_PROPERTIES(mariadb-install-db PROPERTIES COMPILE_DEFINITIONS
+ "INSTALL_PLUGINDIR=${INSTALL_PLUGINDIR};INSTALL_SHAREDIR=${INSTALL_SHAREDIR}"
+ )
TARGET_LINK_LIBRARIES(mariadb-install-db mysys shlwapi)
ADD_LIBRARY(winservice STATIC winservice.c)