After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769217 - Vinagre crashes when RDP server refuses connection
Vinagre crashes when RDP server refuses connection
Status: RESOLVED FIXED
Product: vinagre
Classification: Applications
Component: RDP
unspecified
Other Linux
: Normal major
: ---
Assigned To: vinagre-maint
vinagre-maint
Depends on:
Blocks:
 
 
Reported: 2016-07-27 11:08 UTC by Michał Kępień
Modified: 2016-07-27 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch against git master (1.56 KB, patch)
2016-07-27 11:08 UTC, Michał Kępień
committed Details | Review

Description Michał Kępień 2016-07-27 11:08:35 UTC
Created attachment 332209 [details] [review]
Proposed patch against git master

The issue is caused by changes introduced by 60dea27.  When the RDP server refuses TCP connections on the specified port, freerdp_connect() causes freerdp_get_last_error() to return 0x2000c.  Due to the way the do-while loop is constructed in open_freerdp(), this effectively causes freerdp_connect() to be called in an infinite loop, which quickly results in a SIGSEGV as FreeRDP does not seem to handle eventfd creation failures nicely (these are caused by exceeding the per-process limit of open file descriptors).

As the error string for error 0x2000c is "protocol security negotiation or connection failure", to at least allow refused connections to be handled gracefully, some limit should be enforced on the number of loop iterations inside open_freerdp().  I attached a patch against git master showing one possible way of solving the issue (I see no point in endlessly asking the user for credentials).
Comment 1 David King 2016-07-27 12:07:17 UTC
Review of attachment 332209 [details] [review]:

Seems reasonable to me. Do you have commit access? If not, I will push it for you.
Comment 2 Michał Kępień 2016-07-27 12:10:02 UTC
Thanks for a quick review.  I do not have commit access, so please push the patch for me.
Comment 3 David King 2016-07-27 12:21:58 UTC
Review of attachment 332209 [details] [review]:

Pushed to master as commit d7b4f88943e8615d252d27e1efc58cb64a9e1821. Many thanks for the report and patch!