From 16d2ff95642c9ad49b717077f45b23c97a304305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 22 May 2018 13:25:41 +0300 Subject: [PATCH] Set read and execute permissions for all paths If a path requires read or execute permission, it is granted to all. This keeps path parameters in line with other directories that MaxScale creates. --- server/core/config.cc | 4 ++-- server/modules/routing/avrorouter/avro.cc | 3 +++ server/modules/routing/binlogrouter/blr.cc | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/core/config.cc b/server/core/config.cc index d3e122c1b..6f958b468 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -3933,12 +3933,12 @@ static bool check_path_parameter(const MXS_MODULE_PARAM *params, const char *val } if (params->options & MXS_MODULE_OPT_PATH_R_OK) { - mask |= S_IRUSR; + mask |= S_IRUSR | S_IRGRP | S_IROTH; mode |= R_OK; } if (params->options & MXS_MODULE_OPT_PATH_X_OK) { - mask |= S_IXUSR; + mask |= S_IXUSR | S_IXGRP | S_IXOTH; } if (access(buf, mode) == 0) diff --git a/server/modules/routing/avrorouter/avro.cc b/server/modules/routing/avrorouter/avro.cc index 8906957da..5b932b67d 100644 --- a/server/modules/routing/avrorouter/avro.cc +++ b/server/modules/routing/avrorouter/avro.cc @@ -255,6 +255,8 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE() MXS_MODULE_PARAM_PATH, NULL, MXS_MODULE_OPT_PATH_R_OK | + MXS_MODULE_OPT_PATH_W_OK | + MXS_MODULE_OPT_PATH_X_OK | MXS_MODULE_OPT_PATH_CREAT }, { @@ -263,6 +265,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE() MXS_DEFAULT_DATADIR, MXS_MODULE_OPT_PATH_R_OK | MXS_MODULE_OPT_PATH_W_OK | + MXS_MODULE_OPT_PATH_X_OK | MXS_MODULE_OPT_PATH_CREAT }, {"source", MXS_MODULE_PARAM_SERVICE}, diff --git a/server/modules/routing/binlogrouter/blr.cc b/server/modules/routing/binlogrouter/blr.cc index 6ea7c06f6..c122b90ae 100644 --- a/server/modules/routing/binlogrouter/blr.cc +++ b/server/modules/routing/binlogrouter/blr.cc @@ -208,6 +208,7 @@ extern "C" MXS_MODULE* MXS_CREATE_MODULE() MXS_DEFAULT_DATADIR, MXS_MODULE_OPT_PATH_R_OK | MXS_MODULE_OPT_PATH_W_OK | + MXS_MODULE_OPT_PATH_X_OK | MXS_MODULE_OPT_PATH_CREAT }, {"ssl_cert_verification_depth", MXS_MODULE_PARAM_COUNT, "9"},