airpwn / sams2

Automatically exported from code.google.com/p/sams2
GNU General Public License v2.0
0 stars 0 forks source link

(Trac:551) Разделитель домена и имени пользователя %5C #543

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(Trac:551) Originaly reported by master_volkov <info@dv2c.ru> on 2011-04-01 
21:44:25

Я использую Squid Cache: Version 2.7.STABLE9
в качестве разделителя имени пользователя 
и домена я использую "\"

строка от squid в samsredir приходит в виде: 
http://www.anysite.ru/std.css 192.168.1.10/- DOMAINNAME%5Cusername GET - 
myip=192.168.1.1 myport=8080

На разделитель в виде %5C samsredir не реагирует 
как на разделитель и получаеться, что 
такого пользователя "DOMAINNAME%5Cusername" нет.

Используя патч приведенный ниже можно 
избавиться от этой проблемы.

diff -urN sams/src/samsredir.cpp sams-work/src/samsredir.cpp
--- sams/src/samsredir.cpp    2011-04-01 21:26:58.000000000 +0400
+++ sams-work/src/samsredir.cpp     2011-04-01 21:32:46.000000000 +0400
@@ -256,6 +256,12 @@
           continue;
         }

+      size_t found=fields[2].find("%5C");
+      if (found!=string::npos)
+        {
+          fields[2].replace(found,3,"\\");  
+        }
+
       usr = Proxy::findUser (source[0], fields[2]);

       // Пользователь не найден, блокируем доступ

Original issue reported on code.google.com by bl...@nixdev.net on 5 Jun 2011 at 8:17