Hi,
No sure if this is a bug in guacd or the intended behavior and I just don't use
it correctly.
I use guacamole-common-js and the guacd docker image in my system. As part of
the system, in my own js code, I check if login was successful. However, since
version 1.5.4 it doesn't work. The issue is I don't get an error message when
login isn't successful (but in 1.5.3 I did get it).
Looking at the code, I noticed that in
src/libguac/user.c<https://github.com/apache/guacamole-server/blob/main/src/libguac/user.c#L181>
the error message is only sent to client-> socket, but as far as I understand,
because I am not logged in yet, my socket is client->pending_socket, so I never
get the error message. I fixed this by changing this function to send to both
sockets. So I copied the lines that send to 1 socket to also send to the other
socket:
guac_protocol_send_error(user->pending_socket, "Aborted. See logs.",
status);
guac_socket_flush(user->pending_socket);
Here is my implementation for the whole function:
void vguac_user_abort(guac_user* user, guac_protocol_status status,
const char* format, va_list ap) {
/* Only relevant if user is active */
if (user->active) {
/* Log detail of error */
vguac_user_log(user, GUAC_LOG_ERROR, format, ap);
/* Send error immediately, limit information given */
guac_protocol_send_error(user->socket, "Aborted. See logs.", status);
guac_socket_flush(user->socket);
guac_protocol_send_error(user->pending_socket, "Aborted. See logs.",
status);
guac_socket_flush(user->pending_socket);
/* Stop user */
guac_user_stop(user);
}
}
So my questions are: Is the current behavior what's intended and I am missing
something? Or do you think that my change is a good fix?
Thanks!