Hi all.<br><br>Sorry for the garbled v2 patch (in this email thread).<br>Please see the (good-info-view) patch at <a href="http://patchwork.sugarlabs.org/patch/1570/">http://patchwork.sugarlabs.org/patch/1570/</a><br><br><br>
<br>@ Jerry,<br>Please correct me if my observations are different from yours (as described by you in your last email).<br><br><br>@Samul, Daniel, Peter :<br>I have put in the comparative analysis between Gnome-F14, Sugar-F14, Gnome-17 and Fedora-F17 in the patch-description.<br>
<br><br><br><br>Gist ::<br><br>a)<br>In Gnome-F17 and Sugar-F17, NM DOES NOT re-prompt (via the popup dialog), if incorrect credentials are provided.<br>So, WITH or WITHOUT this patch, the client will get blacklisted/unauthorised/whatever if she enters the wrong credentials.<br>
<br><br>b)<br>So, what this patch does is to not re-prompt the user again and again (for the correct/unknowingly-incorrect) credentials, whenever the wifi goes out of range. <br><br>In fact, this patch would solve this seemingly annoying behaviour in Sugar; and thus makes Sugar one-up on Gnome :D<br>
<br><br>c)<br>So, now comes the question of how to enter new credentials.<br>In this respect, I tend to agree with Sascha and Jerry, to have the settings wiped out on a singular basis, via the patch <br><a href="http://patchwork.sugarlabs.org/patch/846/">http://patchwork.sugarlabs.org/patch/846/</a><br>
<br><br><br><br><br>Thanks and Regards,<br>Ajay<br><br><br><br><br><br><br><div class="gmail_quote">On Wed, Jun 27, 2012 at 2:30 PM, Ajay Garg <span dir="ltr"><<a href="mailto:ajay@activitycentral.com" target="_blank">ajay@activitycentral.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Changes of version-2 over version-1 ::<br>
======================================<br>
<br>
* Adding comparative analysis of the behaviour<br>
netween Gnome-F14, Sugar-F14, Gnome-F17, Sugar-F17.<br>
<br>
* Note that there is no change of code.<br>
<br>
<br>
<br>
<br>
=========================================================================================================================<br>
<br>
<br>
<br>
For providing the explanation, let's do a comparative analysis of the behaviour<br>
netween Gnome-F14, Sugar-F14, Gnome-F17, Sugar-F17.<br>
<br>
Note that the bahaviour (especially on Sugar-F17) is WITHOUT applying this patch.<br>
<br>
<br>
======================================================================================================================================================<br>
S.No.|| Environment || Action || Gnome-F14 || Sugar-F14 || Gnome-F17 || Sugar-F17<br>
=====================================================================================================================================================<br>
|| || || || || ||<br>
1. || No connection attempt || CORRECT credentials are || Connection is || Connection is || Connection is || Connection is<br>
|| has been made. Wifi AP || entered on first popup. || successful. || successful. || successful. || successfull.<br>
|| is within range. || || || || ||<br>
|| || || || || ||<br>
=====================================================================================================================================================<br>
|| || || || || ||<br>
2. || No connection attempt || INCORRECT credentials are || Connection is || Connection is || Connection is || Connection is<br>
|| has been made. Wifi AP || entered on first popup. || unsuccessful. || unsuccessful. || unsuccessful. || unsuccessful.<br>
|| is within range. || || Popup re-appears, || Popup re-appears, || Popup DOES NOT re-|| Popup DOES NOT re-<br>
|| || || expecting secrets.|| expecting secrets.|| appear; NM keeps || appear; NM keeps<br>
|| || || || || trying with the || trying with the<br>
|| || || || || (INCORRECT) || (INCORRECT)<br>
|| || || || || secrets. || secrets.<br>
|| || || || || ||<br>
=====================================================================================================================================================<br>
|| || || || || ||<br>
3. || No connection attempt || CORRECT credentials are || Connection is || Connection is || Connection is || Connection is<br>
|| has been made. Wifi AP || entered on first popup. || unsuccessful. || unsuccessful. || unsuccessful. || unsuccessful.<br>
|| is NOT within range. || || Popup re-appears, || Popup re-appears, || Popup re-appears, || Popup re-appears,<br>
|| || || expecting secrets.|| expecting secrets.|| expecting secrets.|| expecting secrets.<br>
|| || || || || ||<br>
======================================================================================================================================================<br>
|| || || || || ||<br>
4. || No connection attempt || INCORRECT credentials are || Connection is || Connection is || Connection is || Connection is<br>
|| has been made. Wifi AP || entered on first popup. || unsuccessful. || unsuccessful. || unsuccessful. || unsuccessful.<br>
|| is NOT within range. || || Popup re-appears, || Popup re-appears, || Popup re-appears, || Popup re-appears,<br>
|| || || expecting secrets.|| expecting secrets.|| expecting secrets.|| expecting secrets.<br>
|| || || || || ||<br>
====================================================================================================================================================<br>
|| || || || || ||<br>
5. || Wifi is out of range. || Wifi comes within range. || Connection is || Connection is || Connection is || Connection is<br>
|| CORRECT credentials || || successful. || successful. || successful. || successful.<br>
|| have been provided on || || || || ||<br>
|| the last popup. || || || || ||<br>
|| || || || || ||<br>
====================================================================================================================================================<br>
|| || || || || ||<br>
6. || Wifi is out of range. || Wifi comes within range. || Connection is || Connection is || Connection is || Connection is<br>
|| INCORRECT credentials || || unsuccessful. || unsuccessful. || unsuccessful. || unsuccessful.<br>
|| have been provided on || || Popup re-appears, || Popup re-appears, || Popup DOES NOT re-|| Popup DOES NOT re-<br>
|| the last popup. || || expecting secrets.|| expecting secrets.|| appear; NM keeps || appear; NM keeps<br>
|| || || || || trying with the || trying with the<br>
|| || || || || (INCORRECT) || (INCORRECT)<br>
|| || || || || secrets. || secrets.<br>
|| || || || || ||<br>
====================================================================================================================================================<br>
|| || || || || ||<br>
7. || Connection is connected. || Wifi goes out of range. || Connection is || Connection is || Connection is || Connection is<br>
|| (Obviously, Wifi is || || disconnected. || disconnected. || disconnected. || disconnected.<br>
|| within range). || || Popup re-appears, || Popup re-appears, || Popup re-appears, || Popup re-appears,<br>
|| || || expecting secrets.|| expecting secrets.|| expecting secrets.|| expecting secrets.<br>
|| || || || || ||<br>
====================================================================================================================================================<br>
<br>
<br>
<br>
Feelings ::<br>
============<br>
<br>
<br>
a)<br>
Case 1 works as expected on all platforms.<br>
<br>
<br>
b)<br>
Case 2 works as expected on Gnome-F14 and Sugar-F14.<br>
However, just the feeling that the behaviour is a bug on Gnome-F17 and Sugar-F17.<br>
<br>
<br>
c)<br>
Case 3 seems to be a bug on all platforms.<br>
NM should keep trying with the same secrets, till the time AP comes in range.<br>
<br>
THIS PATCH SOLVES THIS FOR GNOME-F17 AND SUGAR-F17.<br>
<br>
<br>
d)<br>
Case 4 is also a bug on all platforms.<br>
NM should keep trying with the same (although incorrect) secrets, till the time AP comes in range.<br>
<br>
THIS PATCH SOLVES THIS FOR GNOME-F17 AND SUGAR-F17.<br>
<br>
<br>
e)<br>
Case 5 works as expected on all platforms.<br>
<br>
<br>
f)<br>
Case 6 works as expected on Gnome-F14 and Sugar-F14.<br>
However, just the feeling that the behaviour is a bug on Gnome-F17 and Sugar-F17.<br>
<br>
<br>
g)<br>
Case 7 seems to be a bug on all platforms.<br>
NM should keep trying with the same secrets, till the time AP comes in range.<br>
<br>
THIS PATCH SOLVES THIS FOR GNOME-F17 AND SUGAR-F17.<br>
<br>
<br>
<br>
<br>
Conclusions ::<br>
==============<br>
<br>
<br>
1.<br>
For Gnome-F17 and Sugar-F17, NM never ever pops up the dialog to re-enter the secrets, as long<br>
as the wifi is within range.<br>
<br>
Thus, entering wrong credentials is not an option.<br>
<br>
If wrong options are entered (with AP having the capability to disable access due to wrong<br>
credentials), that would happen anyways - with or without this patch.<br>
<br>
<br>
2.<br>
What this patch does solve is the prevention of entering the same (correct/incorrect) credentials,<br>
whenever the wifi goes out of range.<br>
<div class="im"><br>
<br>
<br>
<br>
<br>
So now, the intended solution is :::<br>
</div>=======================================<br>
<div class="im"><br>
<br>
1.<br>
Always return the cached secrets (present in 'settings' themselves).<br>
</div>This would make the irritating dialog-box go away (which appears<br>
only when the wifi is out of range).<br>
<br>
<br>
2.<br>
Whenever the credentials need to changed,<br>
<div class="HOEnZb"><div class="h5"><br>
(i) "Discard Network History".<br>
(ii) Click on the wifi icon (in the neighborhood-view).<br>
(iii) Enter the new (publically broadcasted) credentials.<br>
<br>
<br>
<br>
src/jarabe/model/network.py | 34 ++++++++++++++++++++++++++++++++--<br>
1 file changed, 32 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py<br>
index cc02b58..d2f8656 100644<br>
--- a/src/jarabe/model/network.py<br>
+++ b/src/jarabe/model/network.py<br>
@@ -591,8 +591,38 @@ class SecretAgent(dbus.service.Object):<br>
if uid != 0:<br>
raise Exception("UID %d not authorized" % (uid,))<br>
<br>
- response = SecretsResponse(reply, error)<br>
- self.secrets_request.send(self, settings=settings, response=response)<br>
+ # <a href="http://bugs.sugarlabs.org/ticket/3727" target="_blank">http://bugs.sugarlabs.org/ticket/3727</a><br>
+ # <a href="https://dev.laptop.org.au/issues/1305" target="_blank">https://dev.laptop.org.au/issues/1305</a><br>
+ #<br>
+ # 1. See if the secrets are already present in the settings. If they are present,<br>
+ # do not re-prompt the user with the (irritating) popup dialog.<br>
+ #<br>
+ # 2. There might be the thought, as to why at all the 'GetSecrets' method is called<br>
+ # at first place, when the secrets are already a part of the settings. However,<br>
+ # that is the way it is - specifically, this method is called whenever the AP<br>
+ # is out of range. In that case, the user must not be re-prompted with the<br>
+ # popup dialog.<br>
+ if not self.are_secrets_present_in_settings(settings):<br>
+ response = SecretsResponse(reply, error)<br>
+ self.secrets_request.send(self, settings=settings, response=response)<br>
+ else:<br>
+ secrets = {}<br>
+ secrets['802-11-wireless-security'] = settings['802-11-wireless-security']<br>
+ reply(secrets)<br>
+<br>
+ def are_secrets_present_in_settings(self, settings):<br>
+ # The secrets are present in the settings, if<br>
+ #<br>
+ # 1. 'settings' has a dict, keyed by '802-11-wireless-security' AND<br>
+ #<br>
+ # 2. settings['802-11-wireless-security']['key-mgmt'] is present AND<br>
+ #<br>
+ # 3. There is at least one more element in settings['802-11-wireless-security']<br>
+ # (in addition to settings['802-11-wireless-security']['key-mgmt'].<br>
+ if ( '802-11-wireless-security' in settings.keys() ) and \<br>
+ ( len(settings['802-11-wireless-security']) > 1 ):<br>
+ return True<br>
+ return False<br>
<br>
<br>
class AccessPoint(gobject.GObject):<br>
--<br>
1.7.10.2<br>
<br>
</div></div></blockquote></div><br>