Bug#657086: gosa: Should use characters in idGenerator rule, not bytes

2012-01-24 Thread Cajus Pollmeier
Am Montag, 23. Januar 2012, 23:28:33 schrieben Sie:
 Package: gosa
 Version: 2.6.11-3
 Severity: important
 User: debian-...@lists.debian.org
 Usertags: debian-edu
 
 I discovered this problem in Debian Edu/Squeeze.  When a user with a
 non-ASCII character in the third position of the first or last name is
 created, the generated username contain a non-valid UTF-8 character.
 
 In Debian Edu, our gosa.conf contain the following rule:
 idGenerator={%givenName[3-6]}{%sn[3-6]}.
 
 When using UTF-8, the range [3-6] at the moment do not refer to
 characters, but bytes in the UTF-8 string.  This caused the user 'Gunnar
 Grændal' to get a propsed username with gungr?, where ? was half the
 UTF-8 bytestream for æ.  I believe it would be better if [3-6] refered
 to characters 3-6, not bytes 3-6.
 
 As non-ASCII usernames can cause problem when trying to log in to
 different systems, I believe it would be best if usernames are always
 converted to ASCII, preferably using the //TRANSLIT rule in glibc.
 
 For the example above, one would then end up with echo gungræ | iconv
 -t ASCII//TRANSLIT = gungrae as the proposed username.

While it is discussable why this bug is important, 2.7.x packages do the 
conversation in another way:

 $value = iconv('UTF-8', 'US-ASCII//TRANSLIT', $value);

Same for the 2.6.x maintainance series. You can simply take the function 
gen_uids from here

https://oss.gonicus.de/labs/gosa/browser/tags/2.6.13/gosa-
core/include/functions.inc

in order to create a patch for squeeze.

HTH,
Cajus


signature.asc
Description: This is a digitally signed message part.


Bug#657086: gosa: Should use characters in idGenerator rule, not bytes

2012-01-23 Thread Petter Reinholdtsen

Package: gosa
Version: 2.6.11-3
Severity: important
User: debian-...@lists.debian.org
Usertags: debian-edu

I discovered this problem in Debian Edu/Squeeze.  When a user with a
non-ASCII character in the third position of the first or last name is
created, the generated username contain a non-valid UTF-8 character.

In Debian Edu, our gosa.conf contain the following rule:
idGenerator={%givenName[3-6]}{%sn[3-6]}.

When using UTF-8, the range [3-6] at the moment do not refer to
characters, but bytes in the UTF-8 string.  This caused the user 'Gunnar
Grændal' to get a propsed username with gungr?, where ? was half the
UTF-8 bytestream for æ.  I believe it would be better if [3-6] refered
to characters 3-6, not bytes 3-6.

As non-ASCII usernames can cause problem when trying to log in to
different systems, I believe it would be best if usernames are always
converted to ASCII, preferably using the //TRANSLIT rule in glibc.

For the example above, one would then end up with echo gungræ | iconv
-t ASCII//TRANSLIT = gungrae as the proposed username.
-- 
Happy hacking
Petter Reinholdtsen



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org