]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1472: wbinfo_group.pl doesn't work with Samba 3.0.21
authorserassio <>
Sat, 24 Dec 2005 17:53:06 +0000 (17:53 +0000)
committerserassio <>
Sat, 24 Dec 2005 17:53:06 +0000 (17:53 +0000)
wbinfo -n output was changed in Samba 3.0.21, adding a SID description
after the SID value:

giove:~# wbinfo -n Staff
S-1-5-21-682003330-854245398-1708537768-1123 Domain Group (2)

So a little change in the wbinfo_group.pl parsing is needed.

helpers/external_acl/wbinfo_group/wbinfo_group.pl

index 3c72c409b8b92b6d9cc1fe0fbe0abbca63e663a7..9710b9f925f10a3805de2a7f6c3bc5b159b4947c 100644 (file)
 #   Jerry Murdock <jmurdock@itraktech.com>
 #
 # Version history:
+#   2005-12-24 Guido Serassio <guido.serassio@acmeconsulting.it>
+#               Fix for wbinfo from Samba 3.0.21
+#
 #   2004-08-15 Henrik Nordstrom <hno@squid-cache.org>
 #              Helper protocol changed to URL escaped in Squid-3.0
-#   2002-07-05 Jerry Murdock <jmurdock@itraktech.com>
-#              Initial release
 #
 #   2005-06-28 Arno Streuli <astreuli@gmail.com>
 #               Add multi group check
+#
+#   2002-07-05 Jerry Murdock <jmurdock@itraktech.com>
+#              Initial release
 
 
 # Disable output buffering
@@ -34,7 +38,7 @@ sub debug {
 #
 sub check {
         local($user, $group) = @_;
-        $groupSID = `wbinfo -n "$group"`;
+        $groupSID = `wbinfo -n "$group" | cut -d" " -f1`;
         chop  $groupSID;
         $groupGID = `wbinfo -Y $groupSID`;
         chop $groupGID;
@@ -57,7 +61,6 @@ while (<STDIN>) {
                $ans = &check($user, $group);
                last if $ans eq "OK";
        }
-       $ans = &check($user, $group);
        &debug ("Sending $ans to squid");
        print "$ans\n";
 }