Subject: x2goserver username length increasing proposal

From: Andrey Igoshin <[email-masked]>
Date: Mon, 18 Aug 2014 18:12:26 +0400

Package: x2goserver
Version: 4.1.0.0-0~1055~ubuntu14.04.1

x2goserver username length increasing proposal

details:

i propose to increase username length. only sanitizer should be changed.
db length for session_id (500) is ok.

patch attached.

-- 
Andrey Igoshin <[email-masked]>               Voronezh State University
sip:            [email-masked]                Network Operation Center
phone: +7 473 2281160, ext. 2020         Voronezh, Russia

--- Utils.pm.ORIG	2014-08-18 11:44:34.000000000 +0400
+++ Utils.pm	2014-08-18 17:58:47.657697766 +0400
@@ -132,8 +132,8 @@
 		$string =~ s/[^a-zA-Z0-9\_\-\$\.\@]//g;
 		if ($string =~ /^([a-zA-Z0-9\_\-\$\.\@]*)$/) {
 			$string = $1;
-			if ($string =~ /^([a-zA-Z\_][a-zA-Z0-9\_\-\.\@]{0,31}[\$]?)\-([\d]{2,4})\-([\d]{9,12})\_[a-zA-Z0-9\_\-]*\_dp[\d]{1,2}$/) {
-				if ((length($1) > 0) and (length($1) < 32)){
+			if ($string =~ /^([a-zA-Z\_][a-zA-Z0-9\_\-\.\@]{0,47}[\$]?)\-([\d]{2,4})\-([\d]{9,12})\_[a-zA-Z0-9\_\-]*\_dp[\d]{1,2}$/) {
+				if ((length($1) > 0) and (length($1) < 48)){
 					return $string;
 				} else {return 0;}
 			} else {return 0;}