You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by Caner ALTUNTAŞ <ca...@krontech.com> on 2020/02/06 12:28:30 UTC

FW: RDP CONNECTION RETURNS THE SAME ERROR CODE FOR ANY ERROR - GUACAMOLE SERVER 1.0.0

Hello,

We are having a problem with guacamole server - rdp protocol in our company project.
We are expected to show detailed and related error message to user. This depends on the error code returning from guacamole server.
For example, when incorrect credentials is sent to guacamole server, it is supposed to return an error code indicating that the credentials are incorrect. So, we would be able to
show a related error message to user. However guacamole server always returns the same error whose code is  GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND whatever happens.

Actually, we observed that server logs the true error message internally. We are just trying to understand why this true error is not returned as function result.

[cid:image001.png@01D5DCFB.15F1FC60]

We traced the source code to find from where final error message is returned. It is the script below.  (the script is placed in "static int guac_rdp_handle_connection(guac_client* client)" method in rdp.c file)

[cid:image002.png@01D5DCFB.E0D6E760]

As you see, the script tries freerdp_connect method and regardless from what happens inside the method when it fails it returns GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND code. However, in our case for example, we are expecting the code to be GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED.

Now we are planning to modify this script. We looked up freerdp class methods and noticed the method freerdp_get_last_error. It can be useful to detect the real error code after freerdp_connect results as false. So, according to the error code returning from freerdp_get_last_error we can make the script return the most suitable error code.

Finally, we would like to ask you that why the script above returns the same error code whatever happens? Is there a real reason that it is implemented so. We do not want to do something wrong by modifying the script and make it effect some other parts of the server. We thought it would be better if it is asked to you :)

Thanks,

Caner ALTUNTAŞ


Re: RDP CONNECTION RETURNS THE SAME ERROR CODE FOR ANY ERROR - GUACAMOLE SERVER 1.0.0

Posted by Mike Jumper <mj...@apache.org>.
On Wed, Feb 12, 2020 at 11:28 PM Caner ALTUNTAŞ <ca...@krontech.com>
wrote:

>
>
> Hello,
>
>
>
> We are having a problem with guacamole server – rdp protocol in our
> company project. ...
>

Caner, please stop resending your original post. Your original post went
out on the dev@ list just fine and received a response:

https://lists.apache.org/thread.html/r319a2548455cd56a69975fbbc9896351889dac25b340e0dba382482a%40%3Cdev.guacamole.apache.org%3E

If you aren't receiving responses, make sure you're subscribed to the list.

- Mike

RDP CONNECTION RETURNS THE SAME ERROR CODE FOR ANY ERROR - GUACAMOLE SERVER 1.0.0

Posted by Caner ALTUNTAŞ <ca...@krontech.com>.
Hello,

We are having a problem with guacamole server - rdp protocol in our company project.
We are expected to show detailed and related error message to user. This depends on the error code returning from guacamole server.
For example, when incorrect credentials is sent to guacamole server, it is supposed to return an error code indicating that the credentials are incorrect. So, we would be able to
show a related error message to user. However guacamole server always returns the same error whose code is  GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND whatever happens.

Actually, we observed that server logs the true error message internally. We are just trying to understand why this true error is not returned as function result.

[cid:image001.png@01D5DCFB.15F1FC60]
(Image - 1)

We traced the source code to find from where final error message is returned. It is the script below.  (the script is placed in "static int guac_rdp_handle_connection(guac_client* client)" method in rdp.c file)

[cid:image002.png@01D5DCFB.E0D6E760]
(Image - 2)

As you see, the script tries freerdp_connect method and regardless from what happens inside the method when it fails it returns GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND code. However, in our case for example, we are expecting the code to be GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED.

Now we are planning to modify this script. We looked up freerdp class methods and noticed the method freerdp_get_last_error. It can be useful to detect the real error code after freerdp_connect results as false. So, according to the error code returning from freerdp_get_last_error we can make the script return the most suitable error code.

Finally, we would like to ask you that why the script above returns the same error code whatever happens? Is there a real reason that it is implemented so. We do not want to do something wrong by modifying the script and make it effect some other parts of the server. We thought it would be better if it is asked to you :)

Thanks,

Caner ALTUNTAŞ


RDP CONNECTION RETURNS THE SAME ERROR CODE FOR ANY ERROR - GUACAMOLE SERVER 1.0.0

Posted by Caner ALTUNTAŞ <ca...@krontech.com>.
Hello,

We are having a problem with guacamole server - rdp protocol in our company project.
We are expected to show detailed and related error message to user. This depends on the error code returning from guacamole server.
For example, when incorrect credentials is sent to guacamole server, it is supposed to return an error code indicating that the credentials are incorrect. So, we would be able to
show a related error message to user. However guacamole server always returns the same error whose code is  GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND whatever happens.

Actually, we observed that server logs the true error message internally. We are just trying to understand why this true error is not returned as function result.

[cid:image001.png@01D5DCFB.15F1FC60]

We traced the source code to find from where final error message is returned. It is the script below.  (the script is placed in "static int guac_rdp_handle_connection(guac_client* client)" method in rdp.c file)

[cid:image002.png@01D5DCFB.E0D6E760]

As you see, the script tries freerdp_connect method and regardless from what happens inside the method when it fails it returns GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND code. However, in our case for example, we are expecting the code to be GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED.

Now we are planning to modify this script. We looked up freerdp class methods and noticed the method freerdp_get_last_error. It can be useful to detect the real error code after freerdp_connect results as false. So, according to the error code returning from freerdp_get_last_error we can make the script return the most suitable error code.

Finally, we would like to ask you that why the script above returns the same error code whatever happens? Is there a real reason that it is implemented so. We do not want to do something wrong by modifying the script and make it effect some other parts of the server. We thought it would be better if it is asked to you :)

Thanks,

Caner ALTUNTAŞ


Re: FW: RDP CONNECTION RETURNS THE SAME ERROR CODE FOR ANY ERROR - GUACAMOLE SERVER 1.0.0

Posted by Mike Jumper <mj...@apache.org>.
On Thu, Feb 6, 2020 at 11:34 AM Caner ALTUNTAŞ <ca...@krontech.com>
wrote:

> ...
>
> Now we are planning to modify this script. We looked up freerdp class
> methods and noticed the method freerdp_get_last_error. It can be useful
> to detect the real error code after freerdp_connect results as false. So,
> according to the error code returning from freerdp_get_last_error we can
> make the script return the most suitable error code.
>

Please feel free to open a JIRA issue and contribute these changes via a PR
when you are ready. I'm not familiar with the full extent of the errors
visible via freerdp_get_last_error(), and you will need to be careful to
map only those errors which make sense to map (not everything should be
exposed to the user), but it should be possible to improve things such that
an appropriate error is forwarded to the user and an appropriate message is
logged on the Guacamole side.

An RDP disconnect due to invalid credentials, etc. is intended to map to a
proper Guacamole error code, though that handling currently only involves
the RDP "disconnect reason" code:

https://github.com/apache/guacamole-server/blob/68a628581866c4d3797cea33d53fa91555cc4383/src/protocols/rdp/error.c

Finally, we would like to ask you that why the script above returns the
> same error code whatever happens? Is there a real reason that it is
> implemented so. We do not want to do something wrong by modifying the
> script and make it effect some other parts of the server. We thought it
> would be better if it is asked to you :)
>

Only because the function freerdp_get_last_error() did not exist in the
versions of FreeRDP that were around at the time the RDP support was
written.

- Mike