Created
August 12, 2020 01:13
-
-
Save byshen/ba22626e745829dfffbacf1e321e39e3 to your computer and use it in GitHub Desktop.
Enhance log messages related to aclCheckPerm()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/msqld/main/process.c b/src/msqld/main/process.c | |
index 41a98bf..1d2dc18 100755 | |
--- a/src/msqld/main/process.c | |
+++ b/src/msqld/main/process.c | |
@@ -102,12 +102,19 @@ extern char *packet; | |
**************************************************************************/ | |
#define _checkWriteAccess(server) \ | |
- if (!aclCheckPerms(WRITE_ACCESS) || server->config.readOnly) \ | |
+ if (!aclCheckPerms(WRITE_ACCESS) ) \ | |
{ \ | |
- netError(query->clientSock,"Access Denied\n"); \ | |
+ netError(query->clientSock,"Access Denied: write access is required.\n"); \ | |
debugTrace(TRACE_OUT,"processQuery()"); \ | |
return; \ | |
+ } \ | |
+ if (server->config.readOnly) \ | |
+ { \ | |
+ netError(query->clientSock,"Access Denied: server is in Read_Only mode\n"); \ | |
+ debugTrace(TRACE_OUT,"processQuery()"); \ | |
+ return; \ | |
} | |
+ | |
@@ -2432,7 +2439,7 @@ void processQuery(server, query, client, queryText) | |
case MSQL_SELECT: | |
if (!aclCheckPerms(READ_ACCESS)) | |
{ | |
- netError(query->clientSock,"Access Denied\n"); | |
+ netError(query->clientSock,"Access Denied: read access is required for SELECT.\n"); | |
debugTrace(TRACE_OUT,"processQuery()"); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment