[Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-16 Thread Simon Schampijer
The avahi service name has a 64 character limit. It consists of
the room name the published-name and the host name.
---
 src/jarabe/model/neighborhood.py |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
index ca4c5bf..aef03b8 100644
--- a/src/jarabe/model/neighborhood.py
+++ b/src/jarabe/model/neighborhood.py
@@ -695,6 +695,15 @@ class Neighborhood(gobject.GObject):
 if account == self._server_account:
 self._link_local_account.enable()
 
+def _limit_published_name(nick):
+""" Limit the nick name to be only 8 characters maximum
+
+The avahi service name has a 64 character limit. It consists of
+the room name the published-name and the host name.
+
+"""
+return nick[:8]
+
 def _ensure_link_local_account(self, account_paths):
 for account_path in account_paths:
 if 'salut' in account_path:
@@ -713,7 +722,7 @@ class Neighborhood(gobject.GObject):
 'first-name': '',
 'last-name': '',
 'jid': self._get_jabber_account_id(),
-'published-name': nick,
+'published-name': self._limit_published_name(nick),
 }
 
 properties = {
-- 
1.7.4

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-23 Thread Simon Schampijer
The avahi service name has a 64 character limit. It consists of
the room name the published-name and the host name.

Signed-off-by: Simon Schampijer 
---
 src/jarabe/model/neighborhood.py |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
index ca4c5bf..f0b3923 100644
--- a/src/jarabe/model/neighborhood.py
+++ b/src/jarabe/model/neighborhood.py
@@ -695,6 +695,15 @@ class Neighborhood(gobject.GObject):
 if account == self._server_account:
 self._link_local_account.enable()
 
+def _limit_published_name(self, nick):
+""" Limit the nick name to be only 8 characters maximum
+
+The avahi service name has a 64 character limit. It consists of
+the room name the published-name and the host name.
+
+"""
+return nick[:8]
+
 def _ensure_link_local_account(self, account_paths):
 for account_path in account_paths:
 if 'salut' in account_path:
@@ -713,7 +722,7 @@ class Neighborhood(gobject.GObject):
 'first-name': '',
 'last-name': '',
 'jid': self._get_jabber_account_id(),
-'published-name': nick,
+'published-name': self._limit_published_name(nick),
 }
 
 properties = {
-- 
1.7.4

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-16 Thread Simon Schampijer
Just in case people are wondering: this patch does only affect internal 
handling. The nick name that is visible in the UI (neighborhood view) is 
not affected by the limiting. It will be displayed in full length.


On 03/16/2011 01:34 PM, Simon Schampijer wrote:

The avahi service name has a 64 character limit. It consists of
the room name the published-name and the host name.
---
  src/jarabe/model/neighborhood.py |   11 ++-
  1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
index ca4c5bf..aef03b8 100644
--- a/src/jarabe/model/neighborhood.py
+++ b/src/jarabe/model/neighborhood.py
@@ -695,6 +695,15 @@ class Neighborhood(gobject.GObject):
  if account == self._server_account:
  self._link_local_account.enable()

+def _limit_published_name(nick):


A self is missing here. Gets introduced in "Fully update the salut 
account information when the nick name changes #10749" (which depends on 
this patch).


Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-16 Thread C. Scott Ananian
On Thu, Mar 17, 2011 at 2:40 AM, Simon Schampijer  wrote:
> Just in case people are wondering: this patch does only affect internal
> handling. The nick name that is visible in the UI (neighborhood view) is not
> affected by the limiting. It will be displayed in full length.

And what are the adverse consequences if there is a conflict between
JoseMariaSuarez and JoseMariaRamirez ?

I think you'd want to show that the potential bugginess is not so bad,
or else hash the names rather than truncate them.
 --scott

-- 
                         ( http://cscott.net/ )
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-16 Thread Simon Schampijer

On 03/16/2011 03:29 PM, C. Scott Ananian wrote:

On Thu, Mar 17, 2011 at 2:40 AM, Simon Schampijer  wrote:

Just in case people are wondering: this patch does only affect internal
handling. The nick name that is visible in the UI (neighborhood view) is not
affected by the limiting. It will be displayed in full length.


And what are the adverse consequences if there is a conflict between
JoseMariaSuarez and JoseMariaRamirez ?

I think you'd want to show that the potential bugginess is not so bad,
or else hash the names rather than truncate them.
  --scott



http://dev.laptop.org/ticket/10737#comment:6

Regards,
   Simon
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-22 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of Wed Mar 16 19:40:11 +0100 2011:

[src/jarabe/model/neighborhood.py]
> > +def _limit_published_name(nick):
> 
> A self is missing here. Gets introduced in "Fully update the salut 
> account information when the nick name changes #10749" (which depends on 
> this patch).

I'd prefer commits to not contain known bugs if we can help it.
Otherwise git bisect breaks on the boundary between two such patches.

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-22 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of Wed Mar 16 20:41:08 +0100 2011:

> > And what are the adverse consequences if there is a conflict between
> > JoseMariaSuarez and JoseMariaRamirez ?
> >
> > I think you'd want to show that the potential bugginess is not so bad,
> > or else hash the names rather than truncate them.
> 
> http://dev.laptop.org/ticket/10737#comment:6

Comment 6 says:

> http://lists.sugarlabs.org/archive/sugar-devel/2011-March/030436.html 

> I actually think it is better to use the nickname and limit it to 8
> characters. For example if you list the
> available services (avahi-browse) you can more easily recognize which
> machine it is offering.

> I think we do not have to worry clashes that way. The presence id is
> 'nick@avahi_client_host_name' and the
> service name would then be 'room_name:nick@avahi_client_host_name' which
> both would be quite unique, I think.

Like Scott [1] I'm worried that avahi_client_host_name might not
actually be unique. Does avahi guarantee this (on all systems, not just
XOs) and if so, how?

Does the other end always use an explicitly announced value or are there
cases where the name needs to be reconstructed?

Sascha

[1] https://dev.laptop.org/ticket/10737#comment:7
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-22 Thread Simon Schampijer

On 03/22/2011 02:00 PM, Sascha Silbe wrote:

Excerpts from Simon Schampijer's message of Wed Mar 16 20:41:08 +0100 2011:


And what are the adverse consequences if there is a conflict between
JoseMariaSuarez and JoseMariaRamirez ?

I think you'd want to show that the potential bugginess is not so bad,
or else hash the names rather than truncate them.


http://dev.laptop.org/ticket/10737#comment:6


Comment 6 says:


http://lists.sugarlabs.org/archive/sugar-devel/2011-March/030436.html



I actually think it is better to use the nickname and limit it to 8
characters. For example if you list the
available services (avahi-browse) you can more easily recognize which
machine it is offering.



I think we do not have to worry clashes that way. The presence id is
'nick@avahi_client_host_name' and the
service name would then be 'room_name:nick@avahi_client_host_name' which
both would be quite unique, I think.


Like Scott [1] I'm worried that avahi_client_host_name might not
actually be unique. Does avahi guarantee this (on all systems, not just
XOs) and if so, how?


Avahi uses "GetHostName" (on the XO this is something like 'xo-a7-2e-70' 
based on the HW address).


In the PS we did use the first 8 characters of the ssh key of the user 
and pushed that into 'published-name'. My first patch was based on that [1].


As I understood Tomeu he wanted to use the nick name instead now to 
enhance the information we give out.


Regards,
   Simon

[1] http://dev.laptop.org/ticket/10737#comment:4
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-25 Thread Sascha Silbe
Excerpts from Simon Schampijer's message of Tue Mar 22 22:49:53 +0100 2011:

> Avahi uses "GetHostName" (on the XO this is something like 'xo-a7-2e-70' 
> based on the HW address).

If GetHostName is based on gethostname(), then it is far from unique.
Most distributions default to a constant name like "debian". The user
can override it during installation, but many users are lazy / don't
care.

> In the PS we did use the first 8 characters of the ssh key of the user 
> and pushed that into 'published-name'. My first patch was based on that [1].
> 
> As I understood Tomeu he wanted to use the nick name instead now to 
> enhance the information we give out.

I can understand the goal of human readable names, but I'm worried about
what happens if the new assumptions (unique host name) are not met.

What exactly does this value get used for? How would a human use it?

Aren't the 'nickname' and 'jid' properties that are part of the same
dictionary more useful to a human in the first place?

> [1] http://dev.laptop.org/ticket/10737#comment:4

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar] Limit the nick name to be only 8 characters maximum #10737

2011-03-29 Thread Simon Schampijer

On 03/25/2011 04:45 PM, Sascha Silbe wrote:

Excerpts from Simon Schampijer's message of Tue Mar 22 22:49:53 +0100 2011:


Avahi uses "GetHostName" (on the XO this is something like 'xo-a7-2e-70'
based on the HW address).


If GetHostName is based on gethostname(), then it is far from unique.
Most distributions default to a constant name like "debian". The user
can override it during installation, but many users are lazy / don't
care.


In the PS we did use the first 8 characters of the ssh key of the user
and pushed that into 'published-name'. My first patch was based on that [1].

As I understood Tomeu he wanted to use the nick name instead now to
enhance the information we give out.


I can understand the goal of human readable names, but I'm worried about
what happens if the new assumptions (unique host name) are not met.


Actually I went back to the original behavior and based the 
'published-name' on the pubkey (see the new patch). I asked Tomeu and he 
agreed on that.


So I hope we are good to go now.

Regards,
   Simon

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel