GUACAMOLE-2181: Rely on automatic stack traces for debug-level logs.
This commit is contained in:
44 files changed
+152
-243
No files matched your search
+8
-5
@@ -78,14 +78,15 @@ public class RequestValidationService {
|
||||
|
||||
// Deny all requests if restrictions cannot be parsed
|
||||
catch (GuacamoleException e) {
|
||||
logger.warn("Authentication request from \"{}\" is DENIED due to parse error: {}", credentials.getRemoteAddress(), e.getMessage());
|
||||
logger.debug("Error parsing authentication request restrictions from guacamole.properties.", e);
|
||||
logger.warn("Authentication request from \"{}\" is DENIED due to "
|
||||
+ "parse error: {}", credentials.getRemoteAddress(), e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
|
||||
// All requests are allowed if no restrictions are defined
|
||||
if (trustedNetworks.isEmpty()) {
|
||||
logger.debug("Authentication request from \"{}\" is ALLOWED (no restrictions).", credentials.getRemoteAddress());
|
||||
logger.debug("Authentication request from \"{}\" is ALLOWED (no "
|
||||
+ "restrictions).", credentials.getRemoteAddress());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -94,14 +95,16 @@ public class RequestValidationService {
|
||||
|
||||
// Request is allowed if any subnet matches
|
||||
if (new IPAddressString(network).contains(new IPAddressString(credentials.getRemoteAddress()))) {
|
||||
logger.debug("Authentication request from \"{}\" is ALLOWED (matched subnet).", credentials.getRemoteAddress());
|
||||
logger.debug("Authentication request from \"{}\" is ALLOWED "
|
||||
+ "(matched subnet).", credentials.getRemoteAddress());
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Otherwise request is denied - no subnets matched
|
||||
logger.debug("Authentication request from \"{}\" is DENIED (did not match subnet).", credentials.getRemoteAddress());
|
||||
logger.debug("Authentication request from \"{}\" is DENIED (did not "
|
||||
+ "match subnet).", credentials.getRemoteAddress());
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
+4
-8
@@ -168,22 +168,19 @@ public class UserDataService {
|
||||
|
||||
// Fail if base64 data is not valid
|
||||
catch (IllegalArgumentException e) {
|
||||
logger.warn("Submitted data is not proper base64.");
|
||||
logger.debug("Invalid base64 data.", e);
|
||||
logger.warn("Submitted data is not proper base64: {}", e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Handle lack of standard UTF-8 support (should never happen)
|
||||
catch (UnsupportedEncodingException e) {
|
||||
logger.error("Unexpected lack of support for UTF-8: {}", e.getMessage());
|
||||
logger.debug("Unable to decode base64 data as UTF-8.", e);
|
||||
logger.error("Unexpected lack of support for UTF-8: {}", e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fail if decryption or key retrieval fails for any reason
|
||||
catch (GuacamoleException e) {
|
||||
logger.error("Decryption of received data failed: {}", e.getMessage());
|
||||
logger.debug("Unable to decrypt received data.", e);
|
||||
logger.error("Decryption of received data failed: {}", e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -205,8 +202,7 @@ public class UserDataService {
|
||||
|
||||
// Fail UserData creation if JSON is invalid/unreadable
|
||||
catch (IOException e) {
|
||||
logger.error("Received JSON is invalid: {}", e.getMessage());
|
||||
logger.debug("Error parsing UserData JSON.", e);
|
||||
logger.error("Received JSON is invalid: {}", e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user