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 703512 - Enabling "Require password" and not typing a password will have inconsistent behavior
Enabling "Require password" and not typing a password will have inconsistent ...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Sharing
git master
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-03 08:17 UTC by celine.LEGUAY
Modified: 2013-07-30 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.92 KB, patch)
2013-07-29 15:37 UTC, Jonh Wendell
needs-work Details | Review
proposed patch, v2 (1.93 KB, patch)
2013-07-30 13:16 UTC, Jonh Wendell
committed Details | Review

Description celine.LEGUAY 2013-07-03 08:17:21 UTC
User can notice that Enabling "Require password" and not typing a password will have inconsistent behavior. On connect a password will be required but user did not type any password, thus will be impossible to connect.
Steps :
1. Boot 
2. Go to settings - sharing
3. Open Screen sharing
4. Enable all options but leave the password blank
5. Connect with vinagre to localhost
6. Observe password is asked but there is no password typed making the connection impossible
Expected outcome
If no password is typed, system will not asked for a password on connect OR system will enforce for a password to be typed
Actual outcome
Leaving the password field blank will require password on connect, but no password has been set.
Comment 1 Jonh Wendell 2013-07-29 15:37:14 UTC
Created attachment 250375 [details] [review]
proposed patch
Comment 2 Bastien Nocera 2013-07-30 12:48:03 UTC
Review of attachment 250375 [details] [review]:

::: panels/sharing/cc-sharing-panel.c
@@ +869,3 @@
+
+  if (gtk_switch_get_active (pw_switch) &&
+      strlen (gtk_entry_get_text (pw_entry)) == 0)

strlen() will crash with NULL pointers, please make this more robust.

@@ +870,3 @@
+  if (gtk_switch_get_active (pw_switch) &&
+      strlen (gtk_entry_get_text (pw_entry)) == 0)
+    {

brace on the same line as the conditional.
Comment 3 Jonh Wendell 2013-07-30 13:16:37 UTC
Created attachment 250466 [details] [review]
proposed patch, v2

fixed the comments.
once approved, may I push to 3.8 as well?
Comment 4 Bastien Nocera 2013-07-30 13:46:32 UTC
Review of attachment 250466 [details] [review]:

Looks good.
Comment 5 Jonh Wendell 2013-07-30 13:57:14 UTC
thanks, pushed to master and gnome-3-8.